net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register()
Subsystems (5)
PATCH 1/1 net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register()
This node pointer is returned by of_find_compatible_node() with refcount incremented in this function. of_node_put() on it before exitting this function.
--- drivers/net/dsa/microchip/lan937x_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/dsa/microchip/lan937x_main.c +3 -1
@@ -238,8 +238,10 @@ static int lan937x_mdio_register(struct ksz_device *dev) ds->slave_mii_bus = bus; ret =lan937x_irq_phy_setup (dev); -if (ret) +if (ret) { +of_node_put (mdio_np);return ret; + } ret =devm_of_mdiobus_register (ds->dev, bus, mdio_np);if (ret) {
Signature · 1 line
2.31.1
Quoted 6 lines · Sun Ke
This node pointer is returned by
of_find_compatible_node()with refcount incremented in this function.of_node_put()on it before exitting this function.Fixes c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link")Signed-off-by Sun Ke <[email protected]>
Andrew
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Thu, 8 Sep 2022 12:02:26 +0800 you wrote:
This node pointer is returned by
of_find_compatible_node()with refcount incremented in this function.of_node_put()on it before exitting this function.Fixes c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link")Signed-off-by Sun Ke <[email protected]>[...]
Here is the summary with links:
- net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register()
https://git.kernel.org/netdev/net-next/c/2f8a786f4724
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html