Skip to content

Commit 9581acb

Browse files
javiercarrascocruzgregkh
authored andcommitted
usb: typec: fix unreleased fwnode_handle in typec_port_register_altmodes()
The 'altmodes_node' fwnode_handle is never released after it is no longer required, which leaks the resource. Add the required call to fwnode_handle_put() when 'altmodes_node' is no longer required. Cc: [email protected] Fixes: 7b458a4 ("usb: typec: Add typec_port_register_altmodes()") Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Javier Carrasco <[email protected]> Link: https://lore.kernel.org/r/20241021-typec-class-fwnode_handle_put-v2-1-3281225d3d27@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b8423a2 commit 9581acb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/typec/class.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,6 +2341,7 @@ void typec_port_register_altmodes(struct typec_port *port,
23412341
altmodes[index] = alt;
23422342
index++;
23432343
}
2344+
fwnode_handle_put(altmodes_node);
23442345
}
23452346
EXPORT_SYMBOL_GPL(typec_port_register_altmodes);
23462347

0 commit comments

Comments
 (0)