Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 336004e2 authored by Felix Fietkau's avatar Felix Fietkau Committed by Johannes Berg
Browse files

mac80211: add more missing checks for VHT tx rates



Fixes a crash on attempting to calculate the frame duration for a VHT
packet (which needs to be handled by hw/driver instead).

Reported-by: default avatarJouni Malinen <j@w1.fi>
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 24a0aa21
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -446,7 +446,8 @@ static void rate_fixup_ratelist(struct ieee80211_vif *vif,
	 *
	 * XXX: Should this check all retry rates?
	 */
	if (!(rates[0].flags & IEEE80211_TX_RC_MCS)) {
	if (!(rates[0].flags &
	      (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS))) {
		u32 basic_rates = vif->bss_conf.basic_rates;
		s8 baserate = basic_rates ? ffs(basic_rates) - 1 : 0;

+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
	rcu_read_unlock();

	/* assume HW handles this */
	if (tx->rate.flags & IEEE80211_TX_RC_MCS)
	if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS))
		return 0;

	/* uh huh? */