mac80211: airtime: Fix an off by one in ieee80211_calc_rx_airtime()
[linux-2.6-microblaze.git] / net / mac80211 / airtime.c
index 63cb002..9fc2968 100644 (file)
@@ -442,7 +442,7 @@ u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw,
                        return 0;
 
                sband = hw->wiphy->bands[status->band];
-               if (!sband || status->rate_idx > sband->n_bitrates)
+               if (!sband || status->rate_idx >= sband->n_bitrates)
                        return 0;
 
                rate = &sband->bitrates[status->rate_idx];