Skip to content

Commit

Permalink
net: ethernet: mtk_eth_soc: fix resource leak in error path
Browse files Browse the repository at this point in the history
In mtk_probe(), when mtk_ppe_init() or mtk_eth_offload_init() failed,
mtk_mdio_cleanup() isn't called. Fix it.

Fixes: ba37b7c ("net: ethernet: mtk_eth_soc: add support for initializing the PPE")
Fixes: 502e84e ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: Yan Cangang <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
nlzy authored and kuba-moo committed Nov 23, 2022
1 parent 3213f80 commit 8110437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mediatek/mtk_eth_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 8110437

Please sign in to comment.