Skip to content

Commit

Permalink
amd-xgbe: Fix error path in xgbe_mod_init()
Browse files Browse the repository at this point in the history
In xgbe_mod_init(), we should do cleanup if some error occurs

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: efbaa82 ("amd-xgbe: Add support to handle device renaming")
Fixes: 47f164d ("amd-xgbe: Add PCI device support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YueHaibing authored and David S. Miller committed Aug 30, 2019
1 parent 8693265 commit b6b4dc4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/net/ethernet/amd/xgbe/xgbe-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,19 @@ static int __init xgbe_mod_init(void)

ret = xgbe_platform_init();
if (ret)
return ret;
goto err_platform_init;

ret = xgbe_pci_init();
if (ret)
return ret;
goto err_pci_init;

return 0;

err_pci_init:
xgbe_platform_exit();
err_platform_init:
unregister_netdevice_notifier(&xgbe_netdev_notifier);
return ret;
}

static void __exit xgbe_mod_exit(void)
Expand Down

0 comments on commit b6b4dc4

Please sign in to comment.