Skip to contentSkip to conversation

PCI: functions/pci-epf-test: fix missing destroy_workqueue() on error in pci_epf_test_init

PATCH In review Qinglang Miao 3 participants 3 messages Oct 28, 2020 – Jan 19, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: functions/pci-epf-test: fix missing destroy_workqueue() on error in pci_epf_test_init

Add the missing destroy_workqueue() before return from pci_epf_test_init() in the error handling case.

---
 drivers/pci/endpoint/functions/pci-epf-test.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/endpoint/functions/pci-epf-test.c +1 -0
index e4e51d884..6854f2525 100644
@@ -918,6 +918,7 @@ static int __init pci_epf_test_init(void)
 	ret = pci_epf_register_driver(&test_driver);
 	if (ret) {
 		pr_err("Failed to register pci epf test driver --> %d\n", ret);
+		destroy_workqueue(kpcitest_workqueue);
 		return ret;
 	}
 
Signature · 1 line
2.23.0
#1 lore raw
Quoted 7 lines · Qinglang Miao

Add the missing destroy_workqueue() before return from pci_epf_test_init() in the error handling case.

---
 drivers/pci/endpoint/functions/pci-epf-test.c | 1 +
 1 file changed, 1 insertion(+)

Need Kishon's ack.

Lorenzo

Quoted 15 lines
drivers/pci/endpoint/functions/pci-epf-test.c +1 -0
index e4e51d884..6854f2525 100644
@@ -918,6 +918,7 @@ static int __init pci_epf_test_init(void)
 	ret = pci_epf_register_driver(&test_driver);
 	if (ret) {
 		pr_err("Failed to register pci epf test driver --> %d\n", ret);
+		destroy_workqueue(kpcitest_workqueue);
 		return ret;
 	}
 
Signature · 1 line
2.23.0
#2 lore raw

Hi Qinglang,

Quoted 4 lines · Lorenzo Pieralisi
Quoted 3 lines · Qinglang Miao

Add the missing destroy_workqueue() before return from pci_epf_test_init() in the error handling case.

Quoted 8 lines
Quoted 4 lines
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 1 +
 1 file changed, 1 insertion(+)

Need Kishon's ack.

Lorenzo

Can you also add destroy_workqueue() in pci_epf_test_exit()?

Thank You,
Kishon

Quoted 16 lines
Quoted 16 lines
drivers/pci/endpoint/functions/pci-epf-test.c +1 -0
index e4e51d884..6854f2525 100644
@@ -918,6 +918,7 @@ static int __init pci_epf_test_init(void)
 	ret = pci_epf_register_driver(&test_driver);
 	if (ret) {
 		pr_err("Failed to register pci epf test driver --> %d\n", ret);
+		destroy_workqueue(kpcitest_workqueue);
 		return ret;
 	}
 
Signature · 1 line
2.23.0