Re: [PATCH v2 1/1] ACPI: device property: Fix node lookup in acpi_graph_get_child_prop_value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 22, 2017 at 10:39 PM, Sakari Ailus
<sakari.ailus@xxxxxxxxxxxxxxx> wrote:
> 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.
>
> Fixes: 79389a83bc38 ("ACPI / property: Add support for remote endpoints")
> Reported-by: Hyungwoo Yang <hyungwoo.yang@xxxxxxxxx>
> Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
> ---
> since v1:
>
> - fwnode_rpoperty_read_u32( fwnode -> child )
>
>  drivers/acpi/property.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index a65c09c..3963098 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1052,7 +1052,7 @@ static struct fwnode_handle *acpi_graph_get_child_prop_value(
>         fwnode_for_each_child_node(fwnode, child) {
>                 u32 nr;
>
> -               if (!fwnode_property_read_u32(fwnode, prop_name, &nr))
> +               if (fwnode_property_read_u32(child, prop_name, &nr))

OK, but it looks like there are two bugs in it (the zero vs nonzero
return value and the first arg), but the changelog only mentions one
of them.

>                         continue;
>
>                 if (val == nr)
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux