Skip to content

Commit

Permalink
platform/chrome: cros_typec_switch: Add missing fwnode_handle_put()
Browse files Browse the repository at this point in the history
[ Upstream commit dc70234 ]

In cros_typec_register_switches(), we should add fwnode_handle_put()
when break out of the iteration device_for_each_child_node()
as it will automatically increase and decrease the refcounter.

Fixes: affc804 ("platform/chrome: cros_typec_switch: Add switch driver")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20230322041657.1857001-1-windhl@126.com
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
windhl authored and gregkh committed May 11, 2023
1 parent 984f880 commit a218b5f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/platform/chrome/cros_typec_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)

return 0;
err_switch:
fwnode_handle_put(fwnode);
cros_typec_unregister_switches(sdata);
return ret;
}
Expand Down

0 comments on commit a218b5f

Please sign in to comment.