Skip to content

Commit

Permalink
platform/surface: aggregator: Add missing fwnode_handle_put()
Browse files Browse the repository at this point in the history
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: fc622b3 ("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>
  • Loading branch information
Liang He authored and Hans de Goede committed Mar 22, 2023
1 parent 8a02d70 commit acd0acb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/platform/surface/aggregator/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit acd0acb

Please sign in to comment.