]> Git Repo - J-linux.git/commitdiff
platform/chrome: cros_ec_typec: fix missing fwnode reference decrement
authorJavier Carrasco <[email protected]>
Sun, 13 Oct 2024 13:20:24 +0000 (15:20 +0200)
committerTzung-Bi Shih <[email protected]>
Mon, 14 Oct 2024 03:32:52 +0000 (03:32 +0000)
The device_for_each_child_node() macro requires explicit calls to
fwnode_handle_put() upon early exits (return, break, goto) to decrement
the fwnode's refcount, and avoid levaing a node reference behind.

Add the missing fwnode_handle_put() after the common label for all error
paths.

Cc: [email protected]
Fixes: fdc6b21e2444 ("platform/chrome: Add Type C connector class driver")
Signed-off-by: Javier Carrasco <[email protected]>
Link: https://lore.kernel.org/r/20241013-cross_ec_typec_fwnode_handle_put-v2-1-9182b2cd7767@gmail.com
Signed-off-by: Tzung-Bi Shih <[email protected]>
drivers/platform/chrome/cros_ec_typec.c

index c7781aea0b88b2066c07107f2a5d2dcf16b999a0..f1324466efac657a064cf48d4533aae20f371fbe 100644 (file)
@@ -409,6 +409,7 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
        return 0;
 
 unregister_ports:
+       fwnode_handle_put(fwnode);
        cros_unregister_ports(typec);
        return ret;
 }
This page took 0.043844 seconds and 4 git commands to generate.