netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr
@ 2022-03-08  7:42 Miaoqian Lin
  2022-03-09 12:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-03-08  7:42 UTC (permalink / raw)
  To: Taras Chornyi, David S. Miller, Jakub Kicinski, Serhiy Pshyk,
	Andrii Savka, Oleksandr Mazur, netdev, linux-kernel
  Cc: linmq006

This node pointer is returned by of_find_compatible_node() with
refcount incremented. Calling of_node_put() to aovid the refcount leak.

Fixes: 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c
index cad93f747d0c..73cd0a4b7291 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_main.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c
@@ -554,6 +554,7 @@ static int prestera_switch_set_base_mac_addr(struct prestera_switch *sw)
 		dev_info(prestera_dev(sw), "using random base mac address\n");
 	}
 	of_node_put(base_mac_np);
+	of_node_put(np);
 
 	return prestera_hw_switch_mac_set(sw, sw->base_mac);
 }
-- 
2.17.1


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

* Re: [PATCH] net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr
  2022-03-08  7:42 [PATCH] net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr Miaoqian Lin
@ 2022-03-09 12:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-09 12:20 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: tchornyi, davem, kuba, serhiy.pshyk, andrii.savka,
	oleksandr.mazur, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue,  8 Mar 2022 07:42:47 +0000 you wrote:
> This node pointer is returned by of_find_compatible_node() with
> refcount incremented. Calling of_node_put() to aovid the refcount leak.
> 
> Fixes: 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 +
>  1 file changed, 1 insertion(+)

Here is the summary with links:
  - net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr
    https://git.kernel.org/netdev/net/c/c9ffa3e2bc45

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:[~2022-03-09 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08  7:42 [PATCH] net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr Miaoqian Lin
2022-03-09 12:20 ` 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).