All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register
@ 2022-06-03 13:32 Miaoqian Lin
  2022-06-05 17:53 ` Andrew Lunn
  2022-06-06 22:04 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Miaoqian Lin @ 2022-06-03 13:32 UTC (permalink / raw)
  To: Rafał Miłecki, Broadcom Kernel Team, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Fainelli,
	Arnd Bergmann, Jon Mason, netdev, linux-kernel
  Cc: linmq006

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: 55954f3bfdac ("net: ethernet: bgmac: move BCMA MDIO Phy code into a separate file")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
changes in v2:
- update Fixes tag.
v1 Link: https://lore.kernel.org/r/20220602133629.35528-1-linmq006@gmail.com
---
 drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
index 086739e4f40a..9b83d5361699 100644
--- a/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
@@ -234,6 +234,7 @@ struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac)
 	np = of_get_child_by_name(core->dev.of_node, "mdio");
 
 	err = of_mdiobus_register(mii_bus, np);
+	of_node_put(np);
 	if (err) {
 		dev_err(&core->dev, "Registration of mii bus failed\n");
 		goto err_free_bus;
-- 
2.25.1


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

* Re: [PATCH v2] net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register
  2022-06-03 13:32 [PATCH v2] net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register Miaoqian Lin
@ 2022-06-05 17:53 ` Andrew Lunn
  2022-06-06 22:04 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2022-06-05 17:53 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Rafał Miłecki, Broadcom Kernel Team, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Fainelli,
	Arnd Bergmann, Jon Mason, netdev, linux-kernel

On Fri, Jun 03, 2022 at 05:32:38PM +0400, Miaoqian Lin wrote:
> of_get_child_by_name() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
> 
> Fixes: 55954f3bfdac ("net: ethernet: bgmac: move BCMA MDIO Phy code into a separate file")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

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

    Andrew

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

* Re: [PATCH v2] net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register
  2022-06-03 13:32 [PATCH v2] net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register Miaoqian Lin
  2022-06-05 17:53 ` Andrew Lunn
@ 2022-06-06 22:04 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-06 22:04 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: rafal, bcm-kernel-feedback-list, davem, edumazet, kuba, pabeni,
	f.fainelli, arnd, jon.mason, netdev, linux-kernel

Hello:

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

On Fri,  3 Jun 2022 17:32:38 +0400 you wrote:
> of_get_child_by_name() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
> 
> Fixes: 55954f3bfdac ("net: ethernet: bgmac: move BCMA MDIO Phy code into a separate file")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> 
> [...]

Here is the summary with links:
  - [v2] net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register
    https://git.kernel.org/netdev/net/c/b8d91399775c

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-06-06 22:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 13:32 [PATCH v2] net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register Miaoqian Lin
2022-06-05 17:53 ` Andrew Lunn
2022-06-06 22:04 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.