* [PATCH] net: ethernet: sunplus: spl2sw: fix OF node leak in spl2sw_probe()
@ 2026-11-27 7:42 zhaofeng2
2026-11-27 7:49 ` netdev-bot+sinfo
0 siblings, 1 reply; 2+ messages in thread
From: zhaofeng2 @ 2026-11-27 7:42 UTC (permalink / raw)
To: Wells Lu; +Cc: Zhao Feng, netdev, linux-kernel
From: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
spl2sw_probe() calls of_get_child_by_name() to obtain the
"ethernet-ports" child node and uses it as the parent for
spl2sw_get_eth_child_node() in a loop, but never releases
the reference, leaking it on every probe (and on every
goto error path).
Drop the reference with of_node_put() once the node is no
longer needed.
Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
---
Verified against current tree. Leak found by code inspection
(OF reference-counting audit of spl2sw_probe()).
net/ethernet/sunplus/spl2sw.c | 2 +--++
1 file changed, 2 insertions(+), 0 deletion(-)
--- a/drivers/net/ethernet/sunplus/spl2sw_driver.c
+++ b/drivers/net/ethernet/sunplus/spl2sw_driver.c
@@ -471,6 +471,8 @@
spl2sw_mac_rx_mode_set(mac);
}
+ of_node_put(eth_ports_np);
+
/* Find first valid net device. */
for (i = 0; i < MAX_NETDEV_NUM; i++) {
if (comm->ndev[i])
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ethernet: sunplus: spl2sw: fix OF node leak in spl2sw_probe()
2026-11-27 7:42 [PATCH] net: ethernet: sunplus: spl2sw: fix OF node leak in spl2sw_probe() zhaofeng2
@ 2026-11-27 7:49 ` netdev-bot+sinfo
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-11-27 7:49 UTC (permalink / raw)
To: zhaofeng2; +Cc: Wells Lu, netdev, linux-kernel
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-27 7:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 7:42 [PATCH] net: ethernet: sunplus: spl2sw: fix OF node leak in spl2sw_probe() zhaofeng2
2026-11-27 7:49 ` netdev-bot+sinfo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox