Skip to content

Commit 5ed74b0

Browse files
tititiou36davem330
authored andcommitted
xgene-v2: Fix a resource leak in the error handling path of 'xge_probe()'
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: ea8ab16 ("drivers: net: xgene-v2: Add MDIO support") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9cf448c commit 5ed74b0

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/ethernet/apm/xgene-v2

1 file changed

+3
-1
lines changed

drivers/net/ethernet/apm/xgene-v2/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,13 @@ static int xge_probe(struct platform_device *pdev)
677677
ret = register_netdev(ndev);
678678
if (ret) {
679679
netdev_err(ndev, "Failed to register netdev\n");
680-
goto err;
680+
goto err_mdio_remove;
681681
}
682682

683683
return 0;
684684

685+
err_mdio_remove:
686+
xge_mdio_remove(ndev);
685687
err:
686688
free_netdev(ndev);
687689

0 commit comments

Comments
 (0)