mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] net: ti: icssm-prueth: Retain port node references until remove
@ 2026-11-23 16:31 Yige Jiang
  0 siblings, 0 replies; only message in thread
From: Yige Jiang @ 2026-11-23 16:31 UTC (permalink / raw)
  To: MD Danish Anwar, Parvathi Pudi
  Cc: Yige Jiang, Roger Quadros, Mohan Reddy Putluru, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-arm-kernel, netdev, linux-kernel

icssm_prueth_probe() takes a reference to each available port node and
stores the nodes in prueth->eth_node[]. Those references are released
both at the end of a successful probe and in icssm_prueth_remove(), leaving
one excess put per port after unbinding the driver.

Keep the references after a successful probe, since the stored nodes are
used during teardown. The existing remove path and probe error path then
each release the references only when they own them.

Fixes: 511f6c1ae093 ("net: ti: icssm-prueth: Adds ICSSM Ethernet driver")
Signed-off-by: Yige Jiang <yigejiang86@gmail.com>
---
AI assistance was used for analysis and patch preparation.

Based on next-20261104 (8b7179210b22).
Compile-tested: arm64, GCC 14.2.0, W=1, drivers/net/ethernet/ti/icssm/icssm_prueth.o;
baseline and patched objects built with no warnings.
Static source review; no hardware, boot, or KASAN test was performed.

 drivers/net/ethernet/ti/icssm/icssm_prueth.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/icssm/icssm_prueth.c b/drivers/net/ethernet/ti/icssm/icssm_prueth.c
index b42c98e861e081d6c616881786b94e8bcde6b944..4f9529e0e404fd9cfee9e7340f2f048442ab938a 100644
--- a/drivers/net/ethernet/ti/icssm/icssm_prueth.c
+++ b/drivers/net/ethernet/ti/icssm/icssm_prueth.c
@@ -2018,10 +2018,6 @@ static int icssm_prueth_probe(struct platform_device *pdev)
 	dev_info(dev, "TI PRU ethernet driver initialized: %s EMAC mode\n",
 		 (!eth0_node || !eth1_node) ? "single" : "dual");
 
-	if (eth1_node)
-		of_node_put(eth1_node);
-	if (eth0_node)
-		of_node_put(eth0_node);
 	return 0;
 
 netdev_unregister:

base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23 16:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 16:31 [PATCH net] net: ti: icssm-prueth: Retain port node references until remove Yige Jiang

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

all inboxes | Powered by JetHome®