Skip to content

Commit 9c41f37

Browse files
javiercarrascocruzTzung-Bi Shih
authored and
Tzung-Bi Shih
committed
platform/chrome: cros_ec_typec: fix missing fwnode reference decrement
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: fdc6b21 ("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]>
1 parent 7cbf289 commit 9c41f37

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/platform/chrome/cros_ec_typec.c

+1
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
409409
return 0;
410410

411411
unregister_ports:
412+
fwnode_handle_put(fwnode);
412413
cros_unregister_ports(typec);
413414
return ret;
414415
}

0 commit comments

Comments
 (0)