Skip to content

Commit

Permalink
bnx2x: free workqueue when driver fail to register
Browse files Browse the repository at this point in the history
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stanislaw Gruszka authored and David S. Miller committed May 8, 2009
1 parent a8679be commit dd21ca6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dd21ca6

Please sign in to comment.