Skip to content

Commit

Permalink
ath11k: Fix memory leak in ath11k_qmi_driver_event_work
Browse files Browse the repository at this point in the history
[ Upstream commit 72de799 ]

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: d5c6515 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Baochen Qiang <bqiang@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210913180246.193388-4-jouni@codeaurora.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Baochen Qiang authored and gregkh committed Nov 18, 2021
1 parent 4519fb9 commit 08fb000
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/wireless/ath/ath11k/qmi.c
Expand Up @@ -2616,8 +2616,10 @@ static void ath11k_qmi_driver_event_work(struct work_struct *work)
list_del(&event->list);
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;
}

switch (event->type) {
case ATH11K_QMI_EVENT_SERVER_ARRIVE:
Expand Down

0 comments on commit 08fb000

Please sign in to comment.