* [PATCH] net: ethernet: ti: netcp_core: fix device_node refcount leak in netcp_probe()
@ 2026-08-13 11:10 Manush Prajwal
2026-08-13 15:19 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Manush Prajwal @ 2026-08-13 11:10 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, netdev, Manush Prajwal
When netcp_create_interface() fails for a given child node,
netcp_probe() jumps to probe_quit_interface, which releases the
"interfaces" parent node but never the "child" node that the
for_each_available_child_of_node() loop was iterating on. Normal loop
progression relies on the iterator itself to drop each nodes
reference; this abrupt goto skips that. Add the missing of_node_put()
for child at the error label.
Signed-off-by: Manush Prajwal <manushprajwal555@gmail.com>
---
drivers/net/ethernet/ti/netcp_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index eb8fc2ed05..a888aa35fa 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -2271,6 +2271,7 @@ static int netcp_probe(struct platform_device *pdev)
return 0;
probe_quit_interface:
+ of_node_put(child);
list_for_each_entry_safe(netcp_intf, netcp_tmp,
&netcp_device->interface_head,
interface_list) {
--
2.46.2.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ethernet: ti: netcp_core: fix device_node refcount leak in netcp_probe()
2026-08-13 11:10 [PATCH] net: ethernet: ti: netcp_core: fix device_node refcount leak in netcp_probe() Manush Prajwal
@ 2026-08-13 15:19 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2026-08-13 15:19 UTC (permalink / raw)
To: Manush Prajwal
Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev
On Thu, Aug 13, 2026 at 04:40:58PM +0530, Manush Prajwal wrote:
> When netcp_create_interface() fails for a given child node,
> netcp_probe() jumps to probe_quit_interface, which releases the
> "interfaces" parent node but never the "child" node that the
> for_each_available_child_of_node() loop was iterating on.
Would for_each_available_child_of_node_scoped() work here?
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-13 15:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 11:10 [PATCH] net: ethernet: ti: netcp_core: fix device_node refcount leak in netcp_probe() Manush Prajwal
2026-08-13 15:19 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox