From 031180dd501b8d4d77d2b38c1f16716d73d08e10 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Sun, 2 Jun 2024 19:11:52 -0400 Subject: [PATCH] ath11k_nss: correctly free skb using ieee80211_free_txskb() While freeing skb in tx completion path for status reinject, inspect or vdevid mismatch, dev_kfree_skb_any() is used but when a function is using functions from mac80211 to free an skb then it should do it consistently and not switch to the generic dev_kfree_skb_any. Otherwise, mac80211 will not be aware of the freed skb and thus not clean up related information in its internal data structures. Hence fix the issue by properly using ieee80211_free_txskb(). Signed-off-by: Sarika Sharma Signed-off-by: Sean Khan --- ...-free-skb-using-ieee80211_free_txskb.patch | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 package/kernel/mac80211/patches/nss/ath11k/910-wifi-ath11k-correctly-free-skb-using-ieee80211_free_txskb.patch diff --git a/package/kernel/mac80211/patches/nss/ath11k/910-wifi-ath11k-correctly-free-skb-using-ieee80211_free_txskb.patch b/package/kernel/mac80211/patches/nss/ath11k/910-wifi-ath11k-correctly-free-skb-using-ieee80211_free_txskb.patch new file mode 100644 index 0000000000..27ea07015b --- /dev/null +++ b/package/kernel/mac80211/patches/nss/ath11k/910-wifi-ath11k-correctly-free-skb-using-ieee80211_free_txskb.patch @@ -0,0 +1,36 @@ +From 2ff5eea9f7a5ad18e1ac8f48c29786083d4abaa3 Mon Sep 17 00:00:00 2001 +From: Sarika Sharma +Date: Thu, 14 Mar 2024 08:44:09 +0530 +Subject: [PATCH] wifi: ath11k: correctly free skb using ieee80211_free_txskb() + +While freeing skb in tx completion path for status reinject, inspect +or vdevid mismatch, dev_kfree_skb_any() is used but when a function +is using functions from mac80211 to free an skb then it should do +it consistently and not switch to the generic dev_kfree_skb_any. +Otherwise, mac80211 will not be aware of the freed skb and thus +not clean up related information in its internal data structures. + +Hence fix the issue by properly using ieee80211_free_txskb(). + +Signed-off-by: Sarika Sharma +--- + drivers/net/wireless/ath/ath11k/dp_tx.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -384,9 +384,13 @@ static void ath11k_dp_tx_free_txbuf(stru + skb_cb = ATH11K_SKB_CB(msdu); + + dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); +- dev_kfree_skb_any(msdu); + + ar = ab->pdevs[mac_id].ar; ++ if (ab->stats_disable) ++ dev_kfree_skb_any(msdu); ++ else ++ ieee80211_free_txskb(ar->hw, msdu); ++ + if (atomic_dec_and_test(&ar->dp.num_tx_pending)) + wake_up(&ar->dp.tx_empty_waitq); + }