Messages in this thread | | | Subject | Re: [PATCH] software node: fix wrong node passed to find nargs_prop | From | Daniel Scally <> | Date | Mon, 20 Dec 2021 23:37:07 +0000 |
| |
Thanks Andy
On 20/12/2021 22:13, Andy Shevchenko wrote: > + Sakari, Dan > > On Monday, December 20, 2021, Clément Léger <clement.leger@bootlin.com > <mailto:clement.leger@bootlin.com>> wrote: > > nargs_prop refers to a property located in the reference that is found > within the nargs property.
I think this is right (it's not used in the ACPI version, and the OF version is quite convoluted so a bit hard to follow)...but also I note that none of the users of fwnode_property_get_reference_args() pass anything to nargs_prop anyway...do we even need this?
Use the correct reference node in call to > property_entry_read_int_array() to retrieve the correct nargs value. > > Fixes: b06184acf751 ("software node: Add > software_node_get_reference_args()")
I think this might have been introduced later...maybe 996b0830f95d1, maybe e933bedd45099
> Signed-off-by: Clément Léger <clement.leger@bootlin.com > <mailto:clement.leger@bootlin.com>> > --- > drivers/base/swnode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c > index 4debcea4fb12..0a482212c7e8 100644 > --- a/drivers/base/swnode.c > +++ b/drivers/base/swnode.c > @@ -529,7 +529,7 @@ software_node_get_reference_args(const struct > fwnode_handle *fwnode, > return -ENOENT; > > if (nargs_prop) { > - error = > property_entry_read_int_array(swnode->node->properties, > + error = > property_entry_read_int_array(ref->node->properties, > nargs_prop, > sizeof(u32), > > &nargs_prop_val, 1); > if (error) > -- > 2.34.1 > > > > -- > With Best Regards, > Andy Shevchenko > >
| |