Re: [PATCH] net: ethernet: sunplus: spl2sw: fix OF node leak in spl2sw_probe()

From: zhaofeng2

Date: Mon Nov 30 2026 - 02:15:55 EST


From: Zhao Feng <zhaofeng2@xxxxxxxxxxxxxxxxxxxx>

Hi,

Following up on the two pre-existing leaks the review noted:

> - spl2sw_get_eth_child_node() returns early from inside
> for_each_child_of_node(), and the port_np reference it returns is
> never released.
> - phy_np leaks on the error exits.

Both confirmed. To keep v2 focused on the eth_ports_np leak it set
out to fix, I've sent these as a separate follow-up patch
("net: ethernet: sunplus: spl2sw: fix further OF node leaks in probe
and remove"), which additionally drops mac->phy_node in the
out_unregister_dev unwind and in spl2sw_remove(). It applies on top
of v2.

Thanks,
Zhao Feng