net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr
Subsystems (3)
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")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/prestera/prestera_main.c +1 -0
@@ -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
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. Callingof_node_put()to aovid the refcount leak.Fixes 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices")Signed-off-by Miaoqian Lin <[email protected]>--- 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