Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <linmq006@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Miaoqian Lin and committed by
David S. Miller
c9ffa3e2 2169b792

+1
+1
drivers/net/ethernet/marvell/prestera/prestera_main.c
··· 554 554 dev_info(prestera_dev(sw), "using random base mac address\n"); 555 555 } 556 556 of_node_put(base_mac_np); 557 + of_node_put(np); 557 558 558 559 return prestera_hw_switch_mac_set(sw, sw->base_mac); 559 560 }