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@vger.kernel.org Fixes: 9afaf0eec2ab ("net: dsa: microchip: Refactor MDIO handling for side MDIO access") Signed-off-by: Ma Ke make24@iscas.ac.cn
Reviewed-by: Oleksij Rempel o.rempel@pengutronix.de
Thank you!
Best Regards, Oleksij