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 <caravena@gmail.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This commit is contained in:
Lv Zheng 2017-06-26 08:30:17 +08:00
parent beb7833ef1
commit 73512384c9

View File

@ -522,6 +522,11 @@ AcpiPutTable (
ACPI_FUNCTION_TRACE (AcpiPutTable);
if (!Table)
{
return_VOID;
}
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
/* Walk the root table list */