]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: device property: Fix node lookup in acpi_graph_get_child_prop_value()
authorSakari Ailus <sakari.ailus@linux.intel.com>
Tue, 22 Aug 2017 20:39:58 +0000 (23:39 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Aug 2017 20:58:38 +0000 (22:58 +0200)
commit4bf622ea246cd2dfd57355f6a8fce887c3a4dc67
tree86c1a98b3f8543a36fde781c1f4b8b0a57e0d7e5
parentac553adeaed389a4ca502af39e15420283aebeaf
ACPI: device property: Fix node lookup in acpi_graph_get_child_prop_value()

acpi_graph_get_child_prop_value() is intended to find a child node with a
certain property value pair. The check

if (!fwnode_property_read_u32(fwnode, prop_name, &nr))
continue;

is faulty: fwnode_property_read_u32() returns zero on success, not on
failure, leading to comparing values only if the searched property was not
found.

Moreover, the check is made against the parent device node instead of
the child one as it should be.

Fixes: 4d970591c068 (ACPI / property: Add support for remote endpoints)
Reported-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: 4.12+ <stable@vger.kernel.org> # 4.12+
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/property.c