platform/surface: aggregator: Add missing fwnode_handle_put()
Subsystems (3)
PATCH 1/1 platform/surface: aggregator: Add missing fwnode_handle_put()
In fwnode_for_each_child_node(), we should add fwnode_handle_put() when break out of the iteration fwnode_for_each_child_node() as it will automatically increase and decrease the refcounter.
--- drivers/platform/surface/aggregator/bus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/surface/aggregator/bus.c +3 -1
@@ -485,8 +485,10 @@ int __ssam_register_clients(struct device *parent, struct ssam_controller *ctrl,* device, so ignore it and continue with the next one. */ status =ssam_add_client_device (parent, ctrl, child); -if (status && status != -ENODEV ) +if (status && status != -ENODEV ) { +fwnode_handle_put (child); goto err; + } }return 0 ;
Signature · 1 line
2.25.1
Quoted 17 lines · Liang He
In
fwnode_for_each_child_node(), we should addfwnode_handle_put()when break out of the iterationfwnode_for_each_child_node()as it will automatically increase and decrease the refcounter.Fixes fc622b3d36e6 ("platform/surface: Set up Surface Aggregator device registry")Signed-off-by Liang He <[email protected]>--- drivers/platform/surface/aggregator/bus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/platform/surface/aggregator/bus.c +0
-0@@ -485,8 +485,10 @@ int __ssam_register_clients(struct device *parent, struct ssam_controller *ctrl,* device, so ignore it and continue with the next one.
drivers/platform/surface/aggregator/bus.c int __ssam_register_clients(struct device *parent, struct ssam_controller *ctrl, · line 494
Quoted 10 lines
drivers/platform/surface/aggregator/bus.c +3
-1*/ status =ssam_add_client_device (parent, ctrl, child); -if (status && status != -ENODEV ) +if (status && status != -ENODEV ) { +fwnode_handle_put (child); goto err; + } }return 0 ;
Thanks for spotting this.
Hi,
Quoted 30 lines · Maximilian Luz
Quoted 16 lines · Liang He
In
fwnode_for_each_child_node(), we should addfwnode_handle_put()when break out of the iterationfwnode_for_each_child_node()as it will automatically increase and decrease the refcounter.Fixes fc622b3d36e6 ("platform/surface: Set up Surface Aggregator device registry")Signed-off-by Liang He <[email protected]>---
drivers/platform/surface/aggregator/bus.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)drivers/platform/surface/aggregator/bus.c +0
-0drivers/platform/surface/aggregator/bus.c int __ssam_register_clients(struct device *parent, struct ssam_controller *ctrl, · line 493
Quoted 10 lines
drivers/platform/surface/aggregator/bus.c +3
-1@@ -485,8 +485,10 @@ int __ssam_register_clients(struct device *parent, struct ssam_controller *ctrl,* device, so ignore it and continue with the next one. */ status = ssam_add_client_device(parent, ctrl, child); - if (status && status != -ENODEV) + if (status && status != -ENODEV) { + fwnode_handle_put(child); goto err; + } } return 0;Thanks for spotting this.
Quoted 1 line
Reviewed-by Maximilian Luz <[email protected]>
Thank you both for the patch / review, I've applied this patch to the pdx86/fixes branch now:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes
I will include this patch in my next fixes pull-req to Linus for the current kernel development cycle.
Regards,
Hans