Skip to contentSkip to conversation

net: ti: icssm-prueth: Retain port node references until remove

PATCH New Yige Jiang 1 participant 1 message Nov 23

Subsystems (3)
lore
Share & tools
lore

Yige Jiang

author
#0 lore raw

PATCH 1/1 net: ti: icssm-prueth: Retain port node references until remove

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")

---
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(-)
drivers/net/ethernet/ti/icssm/icssm_prueth.c +0 -4
index b42c98e861e081d6c616881786b94e8bcde6b944..4f9529e0e404fd9cfee9e7340f2f048442ab938a 100644
@@ -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