[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221120055259.224555-2-nalanzeyu@gmail.com>
Date: Sun, 20 Nov 2022 13:52:58 +0800
From: Yan Cangang <nalanzeyu@...il.com>
To: leon@...nel.org, kuba@...nel.org, Mark-MC.Lee@...iatek.com,
john@...ozen.org, nbd@....name, sean.wang@...iatek.com
Cc: netdev@...r.kernel.org, Yan Cangang <nalanzeyu@...il.com>
Subject: [PATCH net v3 1/2] net: ethernet: mtk_eth_soc: fix resource leak in error path
In mtk_probe(), when mtk_ppe_init() or mtk_eth_offload_init() failed,
mtk_mdio_cleanup() isn't called. Fix it.
Fixes: ba37b7caf1ed ("net: ethernet: mtk_eth_soc: add support for initializing the PPE")
Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: Yan Cangang <nalanzeyu@...il.com>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 1d1f2342e3ec..16269c6c09ac 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4145,13 +4145,13 @@ static int mtk_probe(struct platform_device *pdev)
eth->soc->offload_version, i);
if (!eth->ppe[i]) {
err = -ENOMEM;
- goto err_free_dev;
+ goto err_deinit_mdio;
}
}
err = mtk_eth_offload_init(eth);
if (err)
- goto err_free_dev;
+ goto err_deinit_mdio;
}
for (i = 0; i < MTK_MAX_DEVS; i++) {
--
2.30.2
Powered by blists - more mailing lists