1 From e0bb4659e235770e6f53b3692e958591f49448f5 Mon Sep 17 00:00:00 2001
2 From: Yang Yingliang <yangyingliang@huawei.com>
3 Date: Mon, 17 Oct 2022 11:51:56 +0800
4 Subject: [PATCH 3/3] net: ethernet: mtk_eth_wed: add missing of_node_put()
6 The device_node pointer returned by of_parse_phandle() with refcount
7 incremented, when finish using it, the refcount need be decreased.
9 Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
10 Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
13 drivers/net/ethernet/mediatek/mtk_wed.c | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
16 --- a/drivers/net/ethernet/mediatek/mtk_wed.c
17 +++ b/drivers/net/ethernet/mediatek/mtk_wed.c
18 @@ -1079,7 +1079,7 @@ void mtk_wed_add_hw(struct device_node *
20 pdev = of_find_device_by_node(np);
23 + goto err_of_node_put;
25 get_device(&pdev->dev);
26 irq = platform_get_irq(pdev, 0);
27 @@ -1139,6 +1139,8 @@ unlock:
28 mutex_unlock(&hw_lock);
30 put_device(&pdev->dev);
35 void mtk_wed_exit(void)
36 @@ -1159,6 +1161,7 @@ void mtk_wed_exit(void)
38 debugfs_remove(hw->debugfs_dir);
40 + of_node_put(hw->node);