From: Yan Cangang <nalanzeyu@gmail.com>
To: leon@kernel.org, kuba@kernel.org, Mark-MC.Lee@mediatek.com,
john@phrozen.org, nbd@nbd.name, sean.wang@mediatek.com
Cc: netdev@vger.kernel.org, Yan Cangang <nalanzeyu@gmail.com>
Subject: [PATCH net v3 1/2] net: ethernet: mtk_eth_soc: fix resource leak in error path
Date: Sun, 20 Nov 2022 13:52:58 +0800 [thread overview]
Message-ID: <20221120055259.224555-2-nalanzeyu@gmail.com> (raw)
In-Reply-To: <20221120055259.224555-1-nalanzeyu@gmail.com>
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@gmail.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
next prev parent reply other threads:[~2022-11-20 5:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-20 5:52 [PATCH net v3 0/2] net: ethernet: mtk_eth_soc: fix memory leak in error path Yan Cangang
2022-11-20 5:52 ` Yan Cangang [this message]
2022-11-20 5:52 ` [PATCH net v3 2/2] " Yan Cangang
2022-11-22 12:46 ` [PATCH net v3 0/2] " Leon Romanovsky
2022-11-23 5:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221120055259.224555-2-nalanzeyu@gmail.com \
--to=nalanzeyu@gmail.com \
--cc=Mark-MC.Lee@mediatek.com \
--cc=john@phrozen.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.