1 From 29d15589f084d71a4ea8c544039c5839db0236e2 Mon Sep 17 00:00:00 2001
2 From: Sven Eckelmann <sven@narfation.org>
3 Date: Tue, 22 Aug 2023 16:42:24 +0300
4 Subject: [PATCH] wifi: ath11k: Cleanup mac80211 references on failure during
7 When a function is using functions from mac80211 to free an skb then it
8 should do it consistently and not switch to the generic dev_kfree_skb_any
9 (or similar functions). Otherwise (like in the error handlers), mac80211
10 will will not be aware of the freed skb and thus not clean up related
11 information in its internal data structures.
13 Not doing so lead in the past to filled up structure which then prevented
14 new clients to connect.
16 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
17 Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode")
18 Cc: stable@vger.kernel.org
19 Signed-off-by: Sven Eckelmann <sven@narfation.org>
20 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
21 Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-2-c0af729d6229@narfation.org
23 drivers/net/wireless/ath/ath11k/dp_tx.c | 6 +++---
24 1 file changed, 3 insertions(+), 3 deletions(-)
26 --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
27 +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
28 @@ -344,7 +344,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
29 dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
32 - dev_kfree_skb_any(msdu);
33 + ieee80211_free_txskb(ar->hw, msdu);
37 @@ -566,12 +566,12 @@ static void ath11k_dp_tx_complete_msdu(s
38 dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
40 if (unlikely(!rcu_access_pointer(ab->pdevs_active[ar->pdev_idx]))) {
41 - dev_kfree_skb_any(msdu);
42 + ieee80211_free_txskb(ar->hw, msdu);
46 if (unlikely(!skb_cb->vif)) {
47 - dev_kfree_skb_any(msdu);
48 + ieee80211_free_txskb(ar->hw, msdu);