X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=net%2Fmac80211%2Fairtime.c;h=8555a0eccf993ae0446f29555865935a2d11bd1f;hb=b823a2e4060448c2f28767e743721bd3ed337d53;hp=26d2f8ba70297dde561b73cbf0a01334bdf21054;hpb=4f6b838c378a52ea3ae0b15f12ca8a20849072fa;p=platform%2Fkernel%2Flinux-rpi.git diff --git a/net/mac80211/airtime.c b/net/mac80211/airtime.c index 26d2f8b..8555a0e 100644 --- a/net/mac80211/airtime.c +++ b/net/mac80211/airtime.c @@ -457,6 +457,9 @@ static u32 ieee80211_get_rate_duration(struct ieee80211_hw *hw, (status->encoding == RX_ENC_HE && streams > 8))) return 0; + if (idx >= MCS_GROUP_RATES) + return 0; + duration = airtime_mcs_groups[group].duration[idx]; duration <<= airtime_mcs_groups[group].shift; *overhead = 36 + (streams << 2); @@ -477,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];