[PATCH ath-next v3 09/13] wifi: ath11k: release the QMI handle when the QMI service init fails
From: Julius Bairaktaris
Date: Sat Nov 21 2026 - 18:08:21 EST
ath11k_qmi_init_service() returns an error without releasing the QMI
handle it initialised when alloc_ordered_workqueue() or qmi_add_lookup()
fails. Its caller ath11k_core_soc_create() does not call
ath11k_qmi_deinit_service() in that case, so the handle's socket,
workqueue and receive buffer are leaked.
Release the handle on both error paths.
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Julius Bairaktaris <julius@xxxxxxxxxxxxxx>
---
v3: new.
drivers/net/wireless/ath/ath11k/qmi.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index aee32aec8732..3ce7c4e5c51c 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -3334,7 +3334,8 @@ int ath11k_qmi_init_service(struct ath11k_base *ab)
ab->qmi.event_wq = alloc_ordered_workqueue("ath11k_qmi_driver_event", 0);
if (!ab->qmi.event_wq) {
ath11k_err(ab, "failed to allocate workqueue\n");
- return -EFAULT;
+ ret = -EFAULT;
+ goto err_release_handle;
}
INIT_LIST_HEAD(&ab->qmi.event_list);
@@ -3347,9 +3348,14 @@ int ath11k_qmi_init_service(struct ath11k_base *ab)
if (ret < 0) {
ath11k_warn(ab, "failed to add qmi lookup: %d\n", ret);
destroy_workqueue(ab->qmi.event_wq);
- return ret;
+ goto err_release_handle;
}
+ return ret;
+
+err_release_handle:
+ qmi_handle_release(&ab->qmi.handle);
+
return ret;
}
--
2.53.0