Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45454400 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman
Browse files

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: ea8ab16a ("drivers: net: xgene-v2: Add MDIO support")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 53b480e6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -677,11 +677,13 @@ static int xge_probe(struct platform_device *pdev)
	ret = register_netdev(ndev);
	if (ret) {
		netdev_err(ndev, "Failed to register netdev\n");
		goto err;
		goto err_mdio_remove;
	}

	return 0;

err_mdio_remove:
	xge_mdio_remove(ndev);
err:
	free_netdev(ndev);