public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: fix unreleased fwnode_handle in typec_port_register_altmodes()
@ 2024-10-19 20:40 Javier Carrasco
  2024-10-21 12:55 ` Heikki Krogerus
  0 siblings, 1 reply; 5+ messages in thread
From: Javier Carrasco @ 2024-10-19 20:40 UTC (permalink / raw)
  To: Heikki Krogerus, Greg Kroah-Hartman, Hans de Goede
  Cc: linux-usb, linux-kernel, stable, Javier Carrasco

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: stable@vger.kernel.org
Fixes: 7b458a4c5d73 ("usb: typec: Add typec_port_register_altmodes()")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/usb/typec/class.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index d61b4c74648d..1eb240604cf6 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -2341,6 +2341,7 @@ void typec_port_register_altmodes(struct typec_port *port,
 		altmodes[index] = alt;
 		index++;
 	}
+	fwnode_handle_put(altmodes_node);
 }
 EXPORT_SYMBOL_GPL(typec_port_register_altmodes);
 

---
base-commit: f2493655d2d3d5c6958ed996b043c821c23ae8d3
change-id: 20241019-typec-class-fwnode_handle_put-b3648f5bc51b

Best regards,
-- 
Javier Carrasco <javier.carrasco.cruz@gmail.com>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-21 14:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-19 20:40 [PATCH] usb: typec: fix unreleased fwnode_handle in typec_port_register_altmodes() Javier Carrasco
2024-10-21 12:55 ` Heikki Krogerus
2024-10-21 13:42   ` Heikki Krogerus
2024-10-21 14:06     ` Javier Carrasco
2024-10-21 14:20       ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox