mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
xgene-v2: Fix a resource leak in the error handling path of 'xge_probe()'
[ Upstream commit5ed74b03eb
] 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:ea8ab16ab2
("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>
This commit is contained in:
parent
99279223a3
commit
076662bfbf
1 changed files with 3 additions and 1 deletions
|
@ -691,11 +691,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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue