Commit 8110437e authored by Yan Cangang's avatar Yan Cangang Committed by Jakub Kicinski

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: ba37b7ca ("net: ethernet: mtk_eth_soc: add support for initializing the PPE")
Fixes: 502e84e2 ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: default avatarYan Cangang <nalanzeyu@gmail.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3213f808
......@@ -4147,13 +4147,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++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment