mirror of
https://github.com/torvalds/linux.git
synced 2024-12-05 02:23:16 +00:00
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:ba37b7caf1
("net: ethernet: mtk_eth_soc: add support for initializing the PPE") Fixes:502e84e238
("net: ethernet: mtk_eth_soc: add flow offloading support") Signed-off-by: Yan Cangang <nalanzeyu@gmail.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
3213f808ae
commit
8110437e59
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user