Commit c9ffa3e2 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by David S. Miller
Browse files

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: 501ef306 ("net: marvell: prestera: Add driver for Prestera family ASIC devices")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2169b792
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
}