Commit 72de799a authored by Baochen Qiang's avatar Baochen Qiang Committed by Kalle Valo

ath11k: Fix memory leak in ath11k_qmi_driver_event_work

The buffer pointed to by event is not freed in case
ATH11K_FLAG_UNREGISTERING bit is set, resulting in
memory leak, so fix it.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1

Fixes: d5c65159 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: default avatarBaochen Qiang <bqiang@codeaurora.org>
Signed-off-by: default avatarJouni Malinen <jouni@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210913180246.193388-4-jouni@codeaurora.org
parent 8a0b899f
...@@ -2759,8 +2759,10 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work) ...@@ -2759,8 +2759,10 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work)
list_del(&event->list); list_del(&event->list);
spin_unlock(&qmi->event_lock); spin_unlock(&qmi->event_lock);
if (test_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags)) if (test_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags)) {
kfree(event);
return; return;
}
switch (event->type) { switch (event->type) {
case ATH11K_QMI_EVENT_SERVER_ARRIVE: case ATH11K_QMI_EVENT_SERVER_ARRIVE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment