Netdev List
 help / color / mirror / Atom feed
From: Manush Prajwal <manushprajwal555@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org,
	Manush Prajwal <manushprajwal555@gmail.com>
Subject: [PATCH] net: ethernet: ti: netcp_core: fix device_node refcount leak in netcp_probe()
Date: Thu, 13 Aug 2026 16:40:58 +0530	[thread overview]
Message-ID: <20260813111058.500-1-manushprajwal555@gmail.com> (raw)

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


             reply	other threads:[~2026-08-13 11:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 11:10 Manush Prajwal [this message]
2026-08-13 15:19 ` [PATCH] net: ethernet: ti: netcp_core: fix device_node refcount leak in netcp_probe() Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260813111058.500-1-manushprajwal555@gmail.com \
    --to=manushprajwal555@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox