335-mac80211-minstrel-fix-tx-status-processing-corner-ca.patch 915 B

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