kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register()
@ 2022-09-08  4:02 Sun Ke
  2022-09-08 12:11 ` Andrew Lunn
  2022-09-19 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Sun Ke @ 2022-09-08  4:02 UTC (permalink / raw)
  To: woojung.huh, UNGLinuxDriver, andrew, vivien.didelot, f.fainelli,
	olteanv, davem, edumazet, kuba, pabeni, linux
  Cc: netdev, kernel-janitors, sunke32

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 <sunke32@huawei.com>
---
 drivers/net/dsa/microchip/lan937x_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c
index 4867aa62dd4c..18ff0b6a92cc 100644
--- a/drivers/net/dsa/microchip/lan937x_main.c
+++ b/drivers/net/dsa/microchip/lan937x_main.c
@@ -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) {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register()
  2022-09-08  4:02 [PATCH] net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register() Sun Ke
@ 2022-09-08 12:11 ` Andrew Lunn
  2022-09-19 21:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2022-09-08 12:11 UTC (permalink / raw)
  To: Sun Ke
  Cc: woojung.huh, UNGLinuxDriver, vivien.didelot, f.fainelli, olteanv,
	davem, edumazet, kuba, pabeni, linux, netdev, kernel-janitors

On Thu, Sep 08, 2022 at 12:02:26PM +0800, Sun Ke 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 <sunke32@huawei.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register()
  2022-09-08  4:02 [PATCH] net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register() Sun Ke
  2022-09-08 12:11 ` Andrew Lunn
@ 2022-09-19 21:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-19 21:30 UTC (permalink / raw)
  To: Sun Ke
  Cc: woojung.huh, UNGLinuxDriver, andrew, vivien.didelot, f.fainelli,
	olteanv, davem, edumazet, kuba, pabeni, linux, netdev,
	kernel-janitors

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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 <sunke32@huawei.com>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-19 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08  4:02 [PATCH] net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register() Sun Ke
2022-09-08 12:11 ` Andrew Lunn
2022-09-19 21:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).