summaryrefslogtreecommitdiff
path: root/drivers/platform/surface/aggregator
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2023-03-22 11:30:57 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-04-06 12:10:43 +0200
commit53dc0b69fbac82ab6b2286728e100a77a862fa83 (patch)
tree8315725082cb06b8b6d96e454c461a454a475014 /drivers/platform/surface/aggregator
parentf0a67ad7dce49d93570edc795e0312bb787f19bb (diff)
downloadlinux-53dc0b69fbac82ab6b2286728e100a77a862fa83.tar.gz
linux-53dc0b69fbac82ab6b2286728e100a77a862fa83.tar.bz2
linux-53dc0b69fbac82ab6b2286728e100a77a862fa83.zip
platform/surface: aggregator: Add missing fwnode_handle_put()
[ Upstream commit acd0acb802b90f88d19ad4337183e44fd0f77c50 ] 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. Fixes: fc622b3d36e6 ("platform/surface: Set up Surface Aggregator device registry") Signed-off-by: Liang He <windhl@126.com> Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> Link: https://lore.kernel.org/r/20230322033057.1855741-1-windhl@126.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/platform/surface/aggregator')
-rw-r--r--drivers/platform/surface/aggregator/bus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/surface/aggregator/bus.c b/drivers/platform/surface/aggregator/bus.c
index de539938896e..b501a79f2a08 100644
--- a/drivers/platform/surface/aggregator/bus.c
+++ b/drivers/platform/surface/aggregator/bus.c
@@ -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;