]> git.itanic.dy.fi Git - linux-stable/commitdiff
platform/chrome: cros_typec_switch: Add missing fwnode_handle_put()
authorLiang He <windhl@126.com>
Wed, 22 Mar 2023 04:16:57 +0000 (12:16 +0800)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 24 Apr 2023 05:35:12 +0000 (13:35 +0800)
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: affc804c44c8 ("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>
drivers/platform/chrome/cros_typec_switch.c

index 9ed1605f4071d724cdffccfcfd528f3ae7c8ff51..752720483753de5a2e8453159787563f4b4b326e 100644 (file)
@@ -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;
 }