aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2009-05-05 19:22:01 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-08 17:52:03 -0400
commitdd21ca6de703230785b755c8290365fc1640200e (patch)
tree3f1214c54e1ded2335393d62a6dae8dbc9f88967 /drivers/net/bnx2x_main.c
parenta8679be2073392cf22a910bc25da0c7d36459845 (diff)
bnx2x: free workqueue when driver fail to register
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index a669bb7eb00c..519e2079f03a 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -11630,13 +11630,20 @@ static struct pci_driver bnx2x_pci_driver = {
11630 11630
11631static int __init bnx2x_init(void) 11631static int __init bnx2x_init(void)
11632{ 11632{
11633 int ret;
11634
11633 bnx2x_wq = create_singlethread_workqueue("bnx2x"); 11635 bnx2x_wq = create_singlethread_workqueue("bnx2x");
11634 if (bnx2x_wq == NULL) { 11636 if (bnx2x_wq == NULL) {
11635 printk(KERN_ERR PFX "Cannot create workqueue\n"); 11637 printk(KERN_ERR PFX "Cannot create workqueue\n");
11636 return -ENOMEM; 11638 return -ENOMEM;
11637 } 11639 }
11638 11640
11639 return pci_register_driver(&bnx2x_pci_driver); 11641 ret = pci_register_driver(&bnx2x_pci_driver);
11642 if (ret) {
11643 printk(KERN_ERR PFX "Cannot register driver\n");
11644 destroy_workqueue(bnx2x_wq);
11645 }
11646 return ret;
11640} 11647}
11641 11648
11642static void __exit bnx2x_cleanup(void) 11649static void __exit bnx2x_cleanup(void)