322-mac80211-add-more-missing-checks-for-VHT-tx-rates.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. From: Felix Fietkau <nbd@openwrt.org>
  2. Date: Fri, 21 Nov 2014 23:27:33 +0100
  3. Subject: [PATCH] mac80211: add more missing checks for VHT tx rates
  4. Fixes a crash on attempting to calculate the frame duration for a VHT
  5. packet (which needs to be handled by hw/driver instead).
  6. Reported-by: Jouni Malinen <j@w1.fi>
  7. Signed-off-by: Felix Fietkau <nbd@openwrt.org>
  8. ---
  9. --- a/net/mac80211/rate.c
  10. +++ b/net/mac80211/rate.c
  11. @@ -446,7 +446,8 @@ static void rate_fixup_ratelist(struct i
  12. *
  13. * XXX: Should this check all retry rates?
  14. */
  15. - if (!(rates[0].flags & IEEE80211_TX_RC_MCS)) {
  16. + if (!(rates[0].flags &
  17. + (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS))) {
  18. u32 basic_rates = vif->bss_conf.basic_rates;
  19. s8 baserate = basic_rates ? ffs(basic_rates) - 1 : 0;
  20. --- a/net/mac80211/tx.c
  21. +++ b/net/mac80211/tx.c
  22. @@ -60,7 +60,7 @@ static __le16 ieee80211_duration(struct
  23. rcu_read_unlock();
  24. /* assume HW handles this */
  25. - if (tx->rate.flags & IEEE80211_TX_RC_MCS)
  26. + if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS))
  27. return 0;
  28. /* uh huh? */