diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-07-13 20:33:33 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-14 13:54:16 -0700 |
commit | 0cf3a14cb2b888a7efa055ff7354e97c59fd48fa (patch) | |
tree | e49edcb7872cdf2f03082056d9d437c2f74c0c77 /drivers | |
parent | 0df170b6078c58d1d2118a5f657fe366ecdc1262 (diff) | |
download | linux-3.10-0cf3a14cb2b888a7efa055ff7354e97c59fd48fa.tar.gz linux-3.10-0cf3a14cb2b888a7efa055ff7354e97c59fd48fa.tar.bz2 linux-3.10-0cf3a14cb2b888a7efa055ff7354e97c59fd48fa.zip |
qlcnic: fix netdev notifier in error path
netdev notifier are not unregistered if pci_register_driver fails.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 0fef8c3c553..0995f90b0ba 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c @@ -3451,6 +3451,7 @@ static struct pci_driver qlcnic_driver = { static int __init qlcnic_init_module(void) { + int ret; printk(KERN_INFO "%s\n", qlcnic_driver_string); @@ -3459,8 +3460,15 @@ static int __init qlcnic_init_module(void) register_inetaddr_notifier(&qlcnic_inetaddr_cb); #endif + ret = pci_register_driver(&qlcnic_driver); + if (ret) { +#ifdef CONFIG_INET + unregister_inetaddr_notifier(&qlcnic_inetaddr_cb); + unregister_netdevice_notifier(&qlcnic_netdev_cb); +#endif + } - return pci_register_driver(&qlcnic_driver); + return ret; } module_init(qlcnic_init_module); |