Skip to content

Commit bc255db

Browse files
Sakari Ailusrkhuangtao
authored andcommitted
UPSTREAM: 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: 79389a83bc38 (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> (cherry picked from commit b5212f57da145e53df790a7e211d94daac768bf8) Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com> BUG=b:64133998 TEST=media device topology shows subdevs registered successfully TEST=no camera regression Change-Id: Ib52ce57f19672c3c15fab66b3abc94dc6d61eb6b Reviewed-on: https://chromium-review.googlesource.com/693683 Commit-Ready: Tomasz Figa <tfiga@chromium.org> Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
1 parent 78c7bff commit bc255db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/property.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ static struct fwnode_handle *acpi_graph_get_child_prop_value(
10471047
fwnode_for_each_child_node(fwnode, child) {
10481048
u32 nr;
10491049

1050-
if (!fwnode_property_read_u32(fwnode, prop_name, &nr))
1050+
if (fwnode_property_read_u32(child, prop_name, &nr))
10511051
continue;
10521052

10531053
if (val == nr)

0 commit comments

Comments
 (0)