iwlegacy: off by one in iwl3945_hw_build_tx_cmd_rate()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
drivers/net/wireless/iwlegacy/iwl-3945.c +1 -1
@@ -676,7 +676,7 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl_priv *priv, int sta_id, int tx_id) {u16 hw_value =ieee80211_get_tx_rate (priv->hw, info)->hw_value; -u16 rate_index =min (hw_value &0xffff ,IWL_RATE_COUNT_3945 ); +u16 rate_index =min (hw_value &0xffff ,IWL_RATE_COUNT_3945 -1 );u16 rate_mask;int rate;u8 rts_retry_limit;
Quoted 6 lines · Dan Carpenter
We use "
rate_index" like this:rate = iwl3945_rates[rate_index].plcp;The iwl3945_rates[] array has
IWL_RATE_COUNT_3945elements so the limit here is off by one.Signed-off-by Dan Carpenter <[email protected]>
Thanks Dan. I queued patch into iwlegacy github tree on top of my current changes, otherwise there would be problems with merging.
Thanks
Stanislaw