mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
mac80211: off by one in mcs mask handling
"ridx" is used as an index into the mcs_mask[] array which has IEEE80211_HT_MCS_MASK_LEN elements. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
d486a5b499
commit
910570b5f4
2 changed files with 2 additions and 2 deletions
|
@ -324,7 +324,7 @@ static bool rate_idx_match_mcs_mask(struct ieee80211_tx_rate *rate,
|
||||||
rbit = rate->idx % 8;
|
rbit = rate->idx % 8;
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
if (ridx < 0 || ridx > IEEE80211_HT_MCS_MASK_LEN)
|
if (ridx < 0 || ridx >= IEEE80211_HT_MCS_MASK_LEN)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* See whether the selected rate or anything below it is allowed. */
|
/* See whether the selected rate or anything below it is allowed. */
|
||||||
|
|
|
@ -5410,7 +5410,7 @@ static bool ht_rateset_to_mask(struct ieee80211_supported_band *sband,
|
||||||
rbit = BIT(rates[i] % 8);
|
rbit = BIT(rates[i] % 8);
|
||||||
|
|
||||||
/* check validity */
|
/* check validity */
|
||||||
if ((ridx < 0) || (ridx > IEEE80211_HT_MCS_MASK_LEN))
|
if ((ridx < 0) || (ridx >= IEEE80211_HT_MCS_MASK_LEN))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* check availability */
|
/* check availability */
|
||||||
|
|
Loading…
Reference in a new issue