Skip to contentSkip to conversation

net: cxgb3: add missed destroy_workqueue in cxgb3 probe failure

PATCH In review Wang Hai 2 participants 3 messages Jul 17, 2020 – Jul 18, 2020

Subsystems (3)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 net: cxgb3: add missed destroy_workqueue in cxgb3 probe failure

The driver forgets to call destroy_workqueue when cxgb3 probe fails. Add the missed calls to fix it.

Fixes 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter, T3.")
---
 drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +1 -0
index 42c6e9379882..060d42803240 100644
@@ -3407,6 +3407,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 out_disable_device:
 	pci_disable_device(pdev);
 out:
+	destroy_workqueue(cxgb3_wq);
 	return err;
 }
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw

From: Wang Hai <[email protected]>
Date: Fri, 17 Jul 2020 14:21:17 +0800

Quoted 6 lines

The driver forgets to call destroy_workqueue when cxgb3 probe fails. Add the missed calls to fix it.

Fixes 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter, T3.")

You have to handle the case that the probing of one or more devices fails yet one or more others succeed.

And you can't know in advance how this will play out.

This is why the workqueue is unconditionally created, and only destroyed on module remove.

#2 lore raw
Quoted 12 lines · David Miller

From: Wang Hai <[email protected]>
Date: Fri, 17 Jul 2020 14:21:17 +0800

Quoted 6 lines

The driver forgets to call destroy_workqueue when cxgb3 probe fails. Add the missed calls to fix it.

Fixes 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter, T3.")

You have to handle the case that the probing of one or more devices fails yet one or more others succeed.

Quoted 6 lines

And you can't know in advance how this will play out.

This is why the workqueue is unconditionally created, and only destroyed on module remove.

.

Thanks for your explanation. I got it.