]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Aug 2014 23:53:52 +0000 (16:53 -0700)
commit6d815092d244e8ce22b50215b99531a69a11467a
tree307f1336559660600247891bf427c116eea7a2d3
parentdbb306f85a0f85883403bd04f52e97f0da75b5ab
ACPI / PNP: Fix acpi_pnp_match()

commit b6328a07bd6b3d31b64f85864fe74f3b08c010ca upstream.

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 202317a573b2 (ACPI / scan:
Add acpi_device objects for all device nodes in the namespace).

Fixes: 202317a573b2 (ACPI / scan: Add acpi_device objects for all device nodes in the namespace)
Reported-and-tested-by: Vinson Lee <vlee@twopensource.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pnp/pnpacpi/core.c