diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-03-08 07:42:47 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-09 12:16:32 +0000 |
commit | c9ffa3e2bc451816ce0295e40063514fabf2bd36 (patch) | |
tree | f8bc2f4eb2ea6f034dd2c45175bd362cf0dc74a7 /drivers | |
parent | 2169b79258c8be803d2595d6456b1e77129fe154 (diff) | |
download | linux-c9ffa3e2bc451816ce0295e40063514fabf2bd36.tar.bz2 |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); } |