mac80211: correct legacy rates check in ieee80211_calc_rx_airtime
[platform/kernel/linux-rpi.git] / net / mac80211 / airtime.c
index 758ef63..8555a0e 100644 (file)
@@ -480,7 +480,9 @@ u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw,
                bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE;
                bool cck;
 
-               if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ))
+               /* on 60GHz or sub-1GHz band, there are no legacy rates */
+               if (WARN_ON_ONCE(status->band == NL80211_BAND_60GHZ ||
+                                status->band == NL80211_BAND_S1GHZ))
                        return 0;
 
                sband = hw->wiphy->bands[status->band];