]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI / PNP: Fix acpi_pnp_match()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 29 Jul 2014 22:23:09 +0000 (00:23 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 29 Jul 2014 22:23:09 +0000 (00:23 +0200)
commit4a522fbdfa1f6320c7944eaaf33a1f257368c76b
treea4dc262168dfbb6cf27112688b7bbdcabfcc50b9
parent222815a13396f7627c2d7fba1177924dc5698256
ACPI / PNP: Fix acpi_pnp_match()

The acpi_pnp_match() function is used for finding the ACPI device
object that should be associated with the given PNP device.
Unfortunately, the check used by that function is not strict enough
and may cause success to be returned for a wrong ACPI device object.

To fix that, use the observation that the pointer to the ACPI
device object in question is already stored in the data field
in struct pnp_dev, so acpi_pnp_match() can simply use that
field to do its job.

This problem was uncovered in 3.14 by commit 889da122607c (ACPI / scan:
Add acpi_device objects for all device nodes in the namespace).

Fixes: 889da122607c (ACPI / scan: Add acpi_device objects for all device nodes in the namespace)
Reported-and-tested-by: Vinson Lee <vlee@twopensource.com>
Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pnp/pnpacpi/core.c