Skip to content

Commit

Permalink
ath9k: index out of bounds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
roel authored and John W. Linville committed Apr 12, 2011
1 parent 0f8e94d commit f0bce44
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/ath/ath9k/rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx;

while (rate->idx > mcs_rix_off[i] &&
i < ARRAY_SIZE(mcs_rix_off)) {
while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
rix++; i++;
}

Expand Down

0 comments on commit f0bce44

Please sign in to comment.