Skip to contentSkip to conversation

crypto: qat - Fix missing destroy_workqueue in adf_init_aer()

PATCH In review Wang Hai 2 participants 2 messages Oct 29, 2024 – Nov 10, 2024

Subsystems (2)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH v2 1/1 crypto: qat - Fix missing destroy_workqueue in adf_init_aer()

The adf_init_aer() won't destroy device_reset_wq when alloc_workqueue() for device_sriov_wq failed. Add destroy_workqueue for device_reset_wq to fix this issue.

Fixes 4469f9b23468 ("crypto: qat - re-enable sriov after pf reset")

---
v1->v2: add 'device_reset_wq = NULL'

 drivers/crypto/intel/qat/qat_common/adf_aer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/crypto/intel/qat/qat_common/adf_aer.c +4 -1
index ec7913ab00a2..4cb8bd83f570 100644
@@ -281,8 +281,11 @@ int adf_init_aer(void)
 		return -EFAULT;
 
 	device_sriov_wq = alloc_workqueue("qat_device_sriov_wq", 0, 0);
-	if (!device_sriov_wq)
+	if (!device_sriov_wq) {
+		destroy_workqueue(device_reset_wq);
+		device_reset_wq = NULL;
 		return -EFAULT;
+	}
 
 	return 0;
 }
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 10 lines · Wang Hai

The adf_init_aer() won't destroy device_reset_wq when alloc_workqueue() for device_sriov_wq failed. Add destroy_workqueue for device_reset_wq to fix this issue.

Fixes 4469f9b23468 ("crypto: qat - re-enable sriov after pf reset")

---
v1->v2: add 'device_reset_wq = NULL'

 drivers/crypto/intel/qat/qat_common/adf_aer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt