From: Wei Yang Date: Sun, 15 Sep 2013 13:53:00 +0000 (+0800) Subject: cxgb4: remove workqueue when driver registration fails X-Git-Tag: firefly_0821_release~176^2~5274^2~25 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=73a695f8572e4c46a2aecdbb63f26f36a43e6873;p=firefly-linux-kernel-4.4.55.git cxgb4: remove workqueue when driver registration fails 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 0d0665ca6f19..c73cabdbd4c0 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -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);