diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-09-14 10:20:10 +0200 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2016-09-22 23:28:22 +0300 |
commit | 7f66ea03644e197a29af5a00a6e26ff120d8edd0 (patch) | |
tree | a198339ab2d8657d4bc42093434b61976a1978d4 /drivers/net/wireless | |
parent | 75cfe338b8a6fadaa28879a969047554701a7589 (diff) | |
download | linux-7f66ea03644e197a29af5a00a6e26ff120d8edd0.tar.gz |
iwlwifi: mvm: correct rate_idx bounds-check
The upper bound IWL_RATE_COUNT_LEGACY should be used
with a >= check, rejecting the value itself; fix that.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index e0c9065a3ad4..ef4bdfc9e7e2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -346,7 +346,7 @@ void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, struct iwl_tx_cmd *tx_cmd, rate_idx = info->control.rates[0].idx; /* if the rate isn't a well known legacy rate, take the lowest one */ - if (rate_idx < 0 || rate_idx > IWL_RATE_COUNT_LEGACY) + if (rate_idx < 0 || rate_idx >= IWL_RATE_COUNT_LEGACY) rate_idx = rate_lowest_index( &mvm->nvm_data->bands[info->band], sta); |