Re: [PATCH net] net: ethernet: sunplus: spl2sw: fix phy_node refcount leak in remove
From: Andrew Lunn
Date: Mon Jun 08 2026 - 03:29:55 EST
On Mon, Jun 08, 2026 at 01:00:29AM +0530, Shitalkumar Gandhi wrote:
> mac->phy_node is acquired via of_parse_phandle() in spl2sw_probe() and
> stored in the mac private data, transferring ownership of the
> device_node reference to mac. On driver removal, spl2sw_phy_remove()
> disconnects the PHY but never drops that reference, so each
> probe-then-remove cycle leaks one of_node refcount per port permanently.
>
> Drop the reference after phy_disconnect(). While at it, remove the
> redundant inner "if (ndev)" check; comm->ndev[i] was just verified
> non-NULL on the line above.
>
> Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Shitalkumar Gandhi <shitalkumar.gandhi@xxxxxxxxxxxxxxxxxxx>
I assume you don't have this hardware, so this is untested? Please
state that in the commit message.
Does this issue bother people?
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Andrew