linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] usb: typec: Drop reference to a fwnode
@ 2024-11-04  8:30 Joe Hattori
  2024-11-04  9:04 ` Heikki Krogerus
  2024-11-04 11:15 ` Dmitry Baryshkov
  0 siblings, 2 replies; 3+ messages in thread
From: Joe Hattori @ 2024-11-04  8:30 UTC (permalink / raw)
  To: heikki.krogerus, gregkh, hdegoede; +Cc: linux-usb, Joe Hattori, stable

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 --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);
 
-- 
2.34.1


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

* Re: [PATCH v2] usb: typec: Drop reference to a fwnode
  2024-11-04  8:30 [PATCH v2] usb: typec: Drop reference to a fwnode Joe Hattori
@ 2024-11-04  9:04 ` Heikki Krogerus
  2024-11-04 11:15 ` Dmitry Baryshkov
  1 sibling, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2024-11-04  9:04 UTC (permalink / raw)
  To: Joe Hattori; +Cc: gregkh, hdegoede, linux-usb, stable

On Mon, Nov 04, 2024 at 05:30:45PM +0900, Joe Hattori wrote:
> 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>

Already fixed: 9581acb91eaf ("usb: typec: fix unreleased
fwnode_handle in typec_port_register_altmodes()")

thanks,

-- 
heikki

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

* Re: [PATCH v2] usb: typec: Drop reference to a fwnode
  2024-11-04  8:30 [PATCH v2] usb: typec: Drop reference to a fwnode Joe Hattori
  2024-11-04  9:04 ` Heikki Krogerus
@ 2024-11-04 11:15 ` Dmitry Baryshkov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2024-11-04 11:15 UTC (permalink / raw)
  To: Joe Hattori; +Cc: heikki.krogerus, gregkh, hdegoede, linux-usb, stable

On Mon, Nov 04, 2024 at 05:30:45PM +0900, Joe Hattori wrote:
> 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.

Nit: s/This commit adds/Add/g , see
Documentation/process/submitting-patches.rst


Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


> 
> 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(+)
> 

-- 
With best wishes
Dmitry

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

end of thread, other threads:[~2024-11-04 11:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04  8:30 [PATCH v2] usb: typec: Drop reference to a fwnode Joe Hattori
2024-11-04  9:04 ` Heikki Krogerus
2024-11-04 11:15 ` Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).