diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-07-13 16:33:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-14 16:54:16 -0400 |
commit | 0cf3a14cb2b888a7efa055ff7354e97c59fd48fa (patch) | |
tree | e49edcb7872cdf2f03082056d9d437c2f74c0c77 /drivers/net/qlcnic/qlcnic_main.c | |
parent | 0df170b6078c58d1d2118a5f657fe366ecdc1262 (diff) |
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/net/qlcnic/qlcnic_main.c')
-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 0fef8c3c553f..0995f90b0bac 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 = { | |||
3451 | 3451 | ||
3452 | static int __init qlcnic_init_module(void) | 3452 | static int __init qlcnic_init_module(void) |
3453 | { | 3453 | { |
3454 | int ret; | ||
3454 | 3455 | ||
3455 | printk(KERN_INFO "%s\n", qlcnic_driver_string); | 3456 | printk(KERN_INFO "%s\n", qlcnic_driver_string); |
3456 | 3457 | ||
@@ -3459,8 +3460,15 @@ static int __init qlcnic_init_module(void) | |||
3459 | register_inetaddr_notifier(&qlcnic_inetaddr_cb); | 3460 | register_inetaddr_notifier(&qlcnic_inetaddr_cb); |
3460 | #endif | 3461 | #endif |
3461 | 3462 | ||
3463 | ret = pci_register_driver(&qlcnic_driver); | ||
3464 | if (ret) { | ||
3465 | #ifdef CONFIG_INET | ||
3466 | unregister_inetaddr_notifier(&qlcnic_inetaddr_cb); | ||
3467 | unregister_netdevice_notifier(&qlcnic_netdev_cb); | ||
3468 | #endif | ||
3469 | } | ||
3462 | 3470 | ||
3463 | return pci_register_driver(&qlcnic_driver); | 3471 | return ret; |
3464 | } | 3472 | } |
3465 | 3473 | ||
3466 | module_init(qlcnic_init_module); | 3474 | module_init(qlcnic_init_module); |