Re: [PATCH] net: dsa: mv88e6xxx: fix netdev reference leak on remove

From: Andrew Lunn

Date: Wed Sep 16 2026 - 08:33:41 EST


On Wed, Sep 16, 2026 at 10:03:40AM +0800, Guangshuo Li wrote:
> mv88e6xxx_probe() uses the referenced network device provided through
> platform data, but the remove path does not drop the corresponding
> reference.
>
> The probe failure path correctly calls dev_put() for pdata->netdev.
> However, after a successful probe, mv88e6xxx_remove() tears down the
> switch resources without releasing this reference, leaving the network
> device reference count unbalanced after driver removal.
>
> Call dev_put() in mv88e6xxx_remove() after the switch resources have
> been torn down.

dev_put() and dev_get() should be used in pairs. Where is the
dev_get()?

Andrew