* [PATCH -next] tsnep: Add missing of_node_put() in tsnep_mdio_init()
@ 2021-11-24 8:40 Yang Yingliang
2021-11-26 3:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2021-11-24 8:40 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: gerhard, kuba, davem
The node pointer is returned by of_get_child_by_name() with
refcount incremented in tsnep_mdio_init(). Calling of_node_put()
to aovid the refcount leak in tsnep_mdio_init().
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/net/ethernet/engleder/tsnep_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c
index 8333313dd706..d7d436d6aed2 100644
--- a/drivers/net/ethernet/engleder/tsnep_main.c
+++ b/drivers/net/ethernet/engleder/tsnep_main.c
@@ -1089,9 +1089,10 @@ static int tsnep_mdio_init(struct tsnep_adapter *adapter)
adapter->mdiobus->phy_mask = 0x0000001;
retval = of_mdiobus_register(adapter->mdiobus, np);
+
+out:
if (np)
of_node_put(np);
-out:
return retval;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] tsnep: Add missing of_node_put() in tsnep_mdio_init()
2021-11-24 8:40 [PATCH -next] tsnep: Add missing of_node_put() in tsnep_mdio_init() Yang Yingliang
@ 2021-11-26 3:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-26 3:30 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, netdev, gerhard, kuba, davem
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 24 Nov 2021 16:40:48 +0800 you wrote:
> The node pointer is returned by of_get_child_by_name() with
> refcount incremented in tsnep_mdio_init(). Calling of_node_put()
> to aovid the refcount leak in tsnep_mdio_init().
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>
> [...]
Here is the summary with links:
- [-next] tsnep: Add missing of_node_put() in tsnep_mdio_init()
https://git.kernel.org/netdev/net-next/c/739752d655b3
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] 2+ messages in thread
end of thread, other threads:[~2021-11-26 3:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-24 8:40 [PATCH -next] tsnep: Add missing of_node_put() in tsnep_mdio_init() Yang Yingliang
2021-11-26 3: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