Commit d71be937 authored by Dan Carpenter's avatar Dan Carpenter Committed by John W. Linville

iwlegacy: off by one in iwl3945_hw_build_tx_cmd_rate()

We use "rate_index" like this:
	rate = iwl3945_rates[rate_index].plcp;
The iwl3945_rates[] array has IWL_RATE_COUNT_3945 elements so the
limit here is off by one.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2b20920d
...@@ -683,7 +683,7 @@ il3945_hw_build_tx_cmd_rate(struct il_priv *il, struct il_device_cmd *cmd, ...@@ -683,7 +683,7 @@ il3945_hw_build_tx_cmd_rate(struct il_priv *il, struct il_device_cmd *cmd,
struct ieee80211_hdr *hdr, int sta_id, int tx_id) struct ieee80211_hdr *hdr, int sta_id, int tx_id)
{ {
u16 hw_value = ieee80211_get_tx_rate(il->hw, info)->hw_value; u16 hw_value = ieee80211_get_tx_rate(il->hw, info)->hw_value;
u16 rate_idx = min(hw_value & 0xffff, RATE_COUNT_3945); u16 rate_idx = min(hw_value & 0xffff, RATE_COUNT_3945 - 1);
u16 rate_mask; u16 rate_mask;
int rate; int rate;
u8 rts_retry_limit; u8 rts_retry_limit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment