xgene-v2: Fix a resource leak in the error handling path of 'xge_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 21 Aug 2021 07:35:23 +0000 (09:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Sep 2021 08:09:24 +0000 (10:09 +0200)
commit850401a23a854ae5e6d7881855c6b8880e8f1563
tree680b04ef413f34e218767514788389ba5f460ae7
parentfb45459d9ddb1edd4a8b087bafe875707753cb10
xgene-v2: Fix a resource leak in the error handling path of 'xge_probe()'

[ Upstream commit 5ed74b03eb4d08f5dd281dcb5f1c9bb92b363a8d ]

A successful 'xge_mdio_config()' call should be balanced by a corresponding
'xge_mdio_remove()' call in the error handling path of the probe, as
already done in the remove function.

Update the error handling path accordingly.

Fixes: ea8ab16ab225 ("drivers: net: xgene-v2: Add MDIO support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/apm/xgene-v2/main.c