Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f66ea03 authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho
Browse files

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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 75cfe338
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
	rate_idx = info->control.rates[0].idx;
	/* if the rate isn't a well known legacy rate, take the lowest one */
	/* 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(
		rate_idx = rate_lowest_index(
				&mvm->nvm_data->bands[info->band], sta);
				&mvm->nvm_data->bands[info->band], sta);