[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220308074247.26332-1-linmq006@gmail.com>
Date: Tue, 8 Mar 2022 07:42:47 +0000
From: Miaoqian Lin <linmq006@...il.com>
To: Taras Chornyi <tchornyi@...vell.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Serhiy Pshyk <serhiy.pshyk@...ision.eu>,
Andrii Savka <andrii.savka@...ision.eu>,
Oleksandr Mazur <oleksandr.mazur@...ision.eu>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: linmq006@...il.com
Subject: [PATCH] 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@...il.com>
---
drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 +
1 file changed, 1 insertion(+)
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);
}
--
2.17.1
Powered by blists - more mailing lists