]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mac80211: fix an off-by-one issue in A-MSDU max_subframe computation
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Thu, 30 Aug 2018 23:04:13 +0000 (01:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:54:21 +0000 (08:54 +0200)
[ Upstream commit 66eb02d839e8495ae6b612e2d09ff599374b80e2 ]

Initialize 'n' to 2 in order to take into account also the first
packet in the estimation of max_subframe limit for a given A-MSDU
since frag_tail pointer is NULL when ieee80211_amsdu_aggregate
routine analyzes the second frame.

Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/tx.c

index 8320282ec3b301b113b4d04b1da2194e2d3b33a3..d8fddd88bf4687d52411add7d63a41bfe340676a 100644 (file)
@@ -3123,7 +3123,7 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata,
        void *data;
        bool ret = false;
        unsigned int orig_len;
-       int n = 1, nfrags, pad = 0;
+       int n = 2, nfrags, pad = 0;
        u16 hdrlen;
 
        if (!ieee80211_hw_check(&local->hw, TX_AMSDU))