net: ethernet: mtk_eth_soc: fix resource leak in error path
authorYan Cangang <nalanzeyu@gmail.com>
Sun, 20 Nov 2022 05:52:58 +0000 (13:52 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Nov 2022 04:16:45 +0000 (20:16 -0800)
commit8110437e59616293228cd781c486d8495a61e36a
treecb93c23a895c6fa7cd534fa22c580ba216bc468d
parent3213f808ae21be3891885de2f3a775afafcda987
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@gmail.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mediatek/mtk_eth_soc.c