net: ethernet: mvneta: Fix error handling in mvneta_probe
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Sun, 20 Dec 2020 08:29:30 +0000 (16:29 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Dec 2020 02:49:45 +0000 (18:49 -0800)
commit58f60329a6be35a5653edb3fd2023ccef9eb9943
treefe4a589341890581a659f6bfe22de837210f9adb
parenta0c8be56affa7d5ffbdec24c992223be54db3b6e
net: ethernet: mvneta: Fix error handling in mvneta_probe

When mvneta_port_power_up() fails, we should execute
cleanup functions after label err_netdev to avoid memleak.

Fixes: 41c2b6b4f0f80 ("net: ethernet: mvneta: Add back interface mode validation")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20201220082930.21623-1-dinghao.liu@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/mvneta.c