1 From 9d4f20a476ca57e4c9246eb1fa2a61bea2354720 Mon Sep 17 00:00:00 2001
2 From: Yang Yingliang <yangyingliang@huawei.com>
3 Date: Mon, 17 Oct 2022 11:51:55 +0800
4 Subject: [PATCH 2/3] net: ethernet: mtk_eth_wed: add missing put_device() in
7 After calling get_device() in mtk_wed_add_hw(), in error path, put_device()
10 Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
11 Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
14 drivers/net/ethernet/mediatek/mtk_wed.c | 10 ++++++++--
15 1 file changed, 8 insertions(+), 2 deletions(-)
17 --- a/drivers/net/ethernet/mediatek/mtk_wed.c
18 +++ b/drivers/net/ethernet/mediatek/mtk_wed.c
19 @@ -1084,11 +1084,11 @@ void mtk_wed_add_hw(struct device_node *
20 get_device(&pdev->dev);
21 irq = platform_get_irq(pdev, 0);
24 + goto err_put_device;
26 regs = syscon_regmap_lookup_by_phandle(np, NULL);
29 + goto err_put_device;
31 rcu_assign_pointer(mtk_soc_wed_ops, &wed_ops);
33 @@ -1131,8 +1131,14 @@ void mtk_wed_add_hw(struct device_node *
37 + mutex_unlock(&hw_lock);
42 mutex_unlock(&hw_lock);
44 + put_device(&pdev->dev);
47 void mtk_wed_exit(void)