From 73512384c9eb1e7f1b28d0a7372df26a3732f96b Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Mon, 26 Jun 2017 08:30:17 +0800 Subject: [PATCH] Tables: Add sanity check in AcpiPutTable() To avoid caller to trigger unexpected warning messages (Link #1): ACPI Warning: Table ffffffffbb461d20, Validation count is zero before decrement Which is reported from AcpiTbPutTable(). When the table is validated, the pointer must be non-zero. Thus the message is not suitable for invalidated tables. This patch fixes the callee side based on this fact. Reported by Cristian Aravena Romero, Fixed by Lv Zheng. Link: https://bugzilla.kernel.org/show_bug.cgi?id=191221 [#1] Reported-by: Cristian Aravena Romero Signed-off-by: Lv Zheng --- source/components/tables/tbxface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/components/tables/tbxface.c b/source/components/tables/tbxface.c index 3f4992885..1a300d41c 100644 --- a/source/components/tables/tbxface.c +++ b/source/components/tables/tbxface.c @@ -522,6 +522,11 @@ AcpiPutTable ( ACPI_FUNCTION_TRACE (AcpiPutTable); + if (!Table) + { + return_VOID; + } + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); /* Walk the root table list */