Skip to contentSkip to conversation

cxgb4: remove workqueue when driver registration fails

PATCH In review Wei Yang 2 participants 3 messages Sep 6, 2013 – Sep 15, 2013

Subsystems (3)
lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +3 -1
index 5a3256b..1dde5a3 100644
@@ -5868,8 +5868,11 @@ 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);
+	}
 	return ret;
 }
 
Signature · 1 line
1.7.1
maintainer
#1 lore raw

From: Wei Yang <[email protected]>
Date: Fri, 6 Sep 2013 09:32:25 +0800

Quoted 6 lines

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.

This patch was corrupted by your email client, please email the patch to yourself, make sure the patch you receive in the email applies cleanly to the current 'net' tree, and then resubmit.

Thanks.

author
#2 lore raw
Quoted 6 lines · David Miller

From: Wei Yang <[email protected]>
Date: Fri, 6 Sep 2013 09:32:25 +0800

Quoted 3 lines

When driver registration fails, we need to clean up the resources allocated before. cxgb4 missed to destroy the workqueue allocated at the very beginning.

Quoted 7 lines
Quoted 3 lines

This patch destroies the workqueue when registration fails.

This patch was corrupted by your email client, please email the patch to yourself, make sure the patch you receive in the email applies cleanly to the current 'net' tree, and then resubmit.

Sorry for this bothering.

I will re-do it.

Thanks.

Quoted 2 lines

Thanks.

Signature · 2 lines
Richard Yang
Help you, Help me