Commit dc70234c authored by Liang He's avatar Liang He Committed by Tzung-Bi Shih

platform/chrome: cros_typec_switch: Add missing fwnode_handle_put()

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: affc804c ("platform/chrome: cros_typec_switch: Add switch driver")
Signed-off-by: default avatarLiang He <windhl@126.com>
Link: https://lore.kernel.org/r/20230322041657.1857001-1-windhl@126.comSigned-off-by: default avatarPrashant Malani <pmalani@chromium.org>
parent 554ec02c
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment