Skip to content

Commit

Permalink
cxgb4: remove workqueue when driver registration fails
Browse files Browse the repository at this point in the history
When driver registration fails, we need to clean up the resources allocated
before. cxgb4 missed to destroy the workqueue allocated at the very beginning.

This patch destroies the workqueue when registration fails.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yang authored and David S. Miller committed Sep 16, 2013
1 parent d6d6d1b commit 73a695f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6149,8 +6149,10 @@ static int __init cxgb4_init_module(void)
pr_warn("could not create debugfs entry, continuing\n");

ret = pci_register_driver(&cxgb4_driver);
if (ret < 0)
if (ret < 0) {
debugfs_remove(cxgb4_debugfs_root);
destroy_workqueue(workq);
}

register_inet6addr_notifier(&cxgb4_inet6addr_notifier);

Expand Down

0 comments on commit 73a695f

Please sign in to comment.