]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI / DMAR: Avoid passing NULL to acpi_put_table()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 5 Jan 2017 01:13:31 +0000 (02:13 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 5 Jan 2017 14:10:52 +0000 (15:10 +0100)
commit902c4d052fb6a2372081dfa27cdb33dc0d651da8
treeb933c78b92d1887fdb28dc7be93af426053da036
parent890fcdd64047a0c9120b237799b69c2be8831d35
ACPI / DMAR: Avoid passing NULL to acpi_put_table()

Linus reported that commit 5d23aa227e03 "ACPICA: Tables: Back port
acpi_get_table_with_size() and early_acpi_os_unmap_memory() from
Linux kernel" added a new warning on his desktop system:

 ACPI Warning: Table ffffffff9fe6c0a0, Validation count is zero before decrement

which turns out to come from the acpi_put_table() in
detect_intel_iommu().

This happens if the DMAR table is not present in which case NULL is
passed to acpi_put_table() which doesn't check against that and
attempts to handle it regardless.

For this reason, check the pointer passed to acpi_put_table()
before invoking it.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Fixes: 242d4c4a6cf9 ("ACPI / osl: Remove acpi_get_table_with_size()/early_acpi_os_unmap_memory() users")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/iommu/dmar.c