diff options
author | roel <roel.kluin@gmail.com> | 2011-04-10 15:09:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-12 16:59:32 -0400 |
commit | f0bce44f5f2eb37dba58aa992d0c58da92ded201 (patch) | |
tree | c802ee8b415477b7dfa8ce9c68935c43460b4af7 /drivers/net | |
parent | 0f8e94d2ae4f7966d09c8105ccabb3b3d8238a4d (diff) |
ath9k: index out of bounds
Check whether index is within bounds before testing the element
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index a3241cd089b1..2a40532126f3 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table, | |||
1092 | if (!(rate->flags & IEEE80211_TX_RC_MCS)) | 1092 | if (!(rate->flags & IEEE80211_TX_RC_MCS)) |
1093 | return rate->idx; | 1093 | return rate->idx; |
1094 | 1094 | ||
1095 | while (rate->idx > mcs_rix_off[i] && | 1095 | while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) { |
1096 | i < ARRAY_SIZE(mcs_rix_off)) { | ||
1097 | rix++; i++; | 1096 | rix++; i++; |
1098 | } | 1097 | } |
1099 | 1098 | ||