Commit a85a0d9f authored by YueHaibing's avatar YueHaibing Committed by Greg Kroah-Hartman

amd-xgbe: Fix error path in xgbe_mod_init()

[ Upstream commit b6b4dc4c ]

In xgbe_mod_init(), we should do cleanup if some error occurs
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Fixes: efbaa828 ("amd-xgbe: Add support to handle device renaming")
Fixes: 47f164de ("amd-xgbe: Add PCI device support")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7ec11cad
...@@ -469,13 +469,19 @@ static int __init xgbe_mod_init(void) ...@@ -469,13 +469,19 @@ static int __init xgbe_mod_init(void)
ret = xgbe_platform_init(); ret = xgbe_platform_init();
if (ret) if (ret)
return ret; goto err_platform_init;
ret = xgbe_pci_init(); ret = xgbe_pci_init();
if (ret) if (ret)
return ret; goto err_pci_init;
return 0; 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) static void __exit xgbe_mod_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment