Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: ethernet: sunplus: Fix ethernet-ports node leak in spl2sw_probe()
@ 2026-09-17 11:41 Wentao Liang
  2026-09-21 13:21 ` netdev-bot+sashiko
  0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-17 11:41 UTC (permalink / raw)
  To: andrew+netdev
  Cc: davem, edumazet, kuba, linux-kernel, netdev, pabeni, wellslutw,
	Wentao Liang, stable

spl2sw_probe() gets a reference on the "ethernet-ports" child node but
never releases it, neither on the error paths that go to out_free_mdio
and out_unregister_dev nor on the successful return. Release the
reference automatically by declaring the node with __free(device_node).

Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/ethernet/sunplus/spl2sw_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sunplus/spl2sw_driver.c b/drivers/net/ethernet/sunplus/spl2sw_driver.c
index 5e0e4c9ecbb0..fdc9c3196738 100644
--- a/drivers/net/ethernet/sunplus/spl2sw_driver.c
+++ b/drivers/net/ethernet/sunplus/spl2sw_driver.c
@@ -319,7 +319,7 @@ static struct device_node *spl2sw_get_eth_child_node(struct device_node *ether_n
 
 static int spl2sw_probe(struct platform_device *pdev)
 {
-	struct device_node *eth_ports_np;
+	struct device_node *eth_ports_np __free(device_node) = NULL;
 	struct device_node *port_np;
 	struct spl2sw_common *comm;
 	struct device_node *phy_np;
-- 
2.34.1


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

end of thread, other threads:[~2026-09-21 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 11:41 [PATCH] net: ethernet: sunplus: Fix ethernet-ports node leak in spl2sw_probe() Wentao Liang
2026-09-21 13:21 ` netdev-bot+sashiko

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