b1c339a1e60b8d32150ab4c658a76a1cd63babc5
[openwrt/staging/neocturne.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 11 Nov 2020 19:25:39 +0100
3 Subject: [PATCH] mac80211: minstrel: fix tx status processing corner case
4
5 Some drivers fill the status rate list without setting the rate index after
6 the final rate to -1. minstrel_ht already deals with this, but minstrel
7 doesn't, which causes it to get stuck at the lowest rate on these drivers.
8
9 Fix this by checking the count as well.
10
11 Cc: stable@vger.kernel.org
12 Fixes: cccf129f820e ("mac80211: add the 'minstrel' rate control algorithm")
13 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 ---
15
16 --- a/net/mac80211/rc80211_minstrel.c
17 +++ b/net/mac80211/rc80211_minstrel.c
18 @@ -274,7 +274,7 @@ minstrel_tx_status(void *priv, struct ie
19 success = !!(info->flags & IEEE80211_TX_STAT_ACK);
20
21 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
22 - if (ar[i].idx < 0)
23 + if (ar[i].idx < 0 || !ar[i].count)
24 break;
25
26 ndx = rix_to_ndx(mi, ar[i].idx);