summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2009-05-06 03:22:01 +0400
committerDavid S. Miller <davem@davemloft.net>2009-05-09 01:52:03 +0400
commitdd21ca6de703230785b755c8290365fc1640200e (patch)
tree3f1214c54e1ded2335393d62a6dae8dbc9f88967
parenta8679be2073392cf22a910bc25da0c7d36459845 (diff)
downloadlinux-dd21ca6de703230785b755c8290365fc1640200e.tar.xz
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>
-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 = {
static int __init bnx2x_init(void)
{
+ int ret;
+
bnx2x_wq = create_singlethread_workqueue("bnx2x");
if (bnx2x_wq == NULL) {
printk(KERN_ERR PFX "Cannot create workqueue\n");
return -ENOMEM;
}
- return pci_register_driver(&bnx2x_pci_driver);
+ ret = pci_register_driver(&bnx2x_pci_driver);
+ if (ret) {
+ printk(KERN_ERR PFX "Cannot register driver\n");
+ destroy_workqueue(bnx2x_wq);
+ }
+ return ret;
}
static void __exit bnx2x_cleanup(void)