mac80211: Fix insufficient headroom issue for AMSDU
authorChih-Kang Chang <gary.chang@realtek.com>
Mon, 16 Aug 2021 08:51:28 +0000 (16:51 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 17 Aug 2021 13:49:58 +0000 (15:49 +0200)
ieee80211_amsdu_realloc_pad() fails to account for extra_tx_headroom,
the original reserved headroom might be eaten. Add the necessary
extra_tx_headroom.

Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://lore.kernel.org/r/20210816085128.10931-2-pkshih@realtek.com
[fix indentation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/tx.c

index 1f7571777fb1e55a7c4e55a09d16880c16a5fec3..2d1193ed3eb524219bd1df328db6531e2ac0d419 100644 (file)
@@ -3242,7 +3242,9 @@ static bool ieee80211_amsdu_prepare_head(struct ieee80211_sub_if_data *sdata,
        if (info->control.flags & IEEE80211_TX_CTRL_AMSDU)
                return true;
 
-       if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr)))
+       if (!ieee80211_amsdu_realloc_pad(local, skb,
+                                        sizeof(*amsdu_hdr) +
+                                        local->hw.extra_tx_headroom))
                return false;
 
        data = skb_push(skb, sizeof(*amsdu_hdr));