[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aR_7fXEMhNeIhRwZ@pengutronix.de>
Date: Fri, 21 Nov 2025 06:41:17 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: Ma Ke <make24@...as.ac.cn>
Cc: woojung.huh@...rochip.com, UNGLinuxDriver@...rochip.com, andrew@...n.ch,
olteanv@...il.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
stable@...r.kernel.org
Subject: Re: [PATCH] net: dsa: microchip: fix mdio parent bus reference leak
Hi,
On Fri, Nov 21, 2025 at 12:20:00PM +0800, Ma Ke wrote:
> In ksz_mdio_register(), when of_mdio_find_bus() is called to get the
> parent MDIO bus, it increments the reference count of the underlying
> device. However, the reference are not released in error paths or
> during switch teardown, causing a reference leak.
>
> Add put_device() in the error path of ksz_mdio_register() and
> ksz_teardown() to release the parent bus.
>
> Found by code review.
>
> Cc: stable@...r.kernel.org
> Fixes: 9afaf0eec2ab ("net: dsa: microchip: Refactor MDIO handling for side MDIO access")
> Signed-off-by: Ma Ke <make24@...as.ac.cn>
Reviewed-by: Oleksij Rempel <o.rempel@...gutronix.de>
Thank you!
Best Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists