net: ethernet: mtk_eth_soc: fix possible memory leak in mtk_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 17 Oct 2022 03:51:54 +0000 (11:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Oct 2022 08:35:05 +0000 (09:35 +0100)
commitb3d0d98179d62f9d55635a600679c4fa362baf8d
treeef060890a45dbfcdf4ff2211159dfe5d33ea8791
parent2d1f274b95c6e4ba6a813b3b8e7a1a38d54a0a08
net: ethernet: mtk_eth_soc: fix possible memory leak in mtk_probe()

If mtk_wed_add_hw() has been called, mtk_wed_exit() needs be called
in error path or removing module to free the memory allocated in
mtk_wed_add_hw().

Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c