aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/3945.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-12-23 02:13:42 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-01-04 14:30:44 -0500
commitd71be937202853eda76562e9678073465d5c0fa8 (patch)
treedd9161a0a8f35737deedd0ccbdc29ea4651efac4 /drivers/net/wireless/iwlegacy/3945.c
parent2b20920d639da3ee275fcc691431b5b3daa9a3e7 (diff)
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/3945.c')
-rw-r--r--drivers/net/wireless/iwlegacy/3945.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 863664f9ba8b..0b99deb48426 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -683,7 +683,7 @@ il3945_hw_build_tx_cmd_rate(struct il_priv *il, struct il_device_cmd *cmd,
683 struct ieee80211_hdr *hdr, int sta_id, int tx_id) 683 struct ieee80211_hdr *hdr, int sta_id, int tx_id)
684{ 684{
685 u16 hw_value = ieee80211_get_tx_rate(il->hw, info)->hw_value; 685 u16 hw_value = ieee80211_get_tx_rate(il->hw, info)->hw_value;
686 u16 rate_idx = min(hw_value & 0xffff, RATE_COUNT_3945); 686 u16 rate_idx = min(hw_value & 0xffff, RATE_COUNT_3945 - 1);
687 u16 rate_mask; 687 u16 rate_mask;
688 int rate; 688 int rate;
689 u8 rts_retry_limit; 689 u8 rts_retry_limit;