diff mbox series

[v2] usb: typec: Drop reference to a fwnode

Message ID 20241104083045.2101350-1-joe@pf.is.s.u-tokyo.ac.jp
State New
Headers show
Series [v2] usb: typec: Drop reference to a fwnode | expand

Commit Message

Joe Hattori Nov. 4, 2024, 8:30 a.m. UTC
In typec_port_register_altmodes(), the fwnode reference obtained by
device_get_named_child_node() is not dropped. This commit adds a call to
fwnode_handle_put() to fix the possible reference leak.

Fixes: 7b458a4c5d73 ("usb: typec: Add typec_port_register_altmodes()")
Cc: stable@vger.kernel.org
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
---
Changes in v2:
- Add the Cc: stable@vger.kernel.org line.
---
 drivers/usb/typec/class.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index 58f40156de56..145e12e13aef 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -2343,6 +2343,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);