Skip to contentSkip to conversation

net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr

PATCH Applied Miaoqian Lin 2 participants 2 messages Mar 8, 2022 – Mar 9, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr

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")
---
 drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/prestera/prestera_main.c +1 -0
index cad93f747d0c..73cd0a4b7291 100644
@@ -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);
 }
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 8 lines · 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")
---
 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html