diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-08-26 17:24:59 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-29 14:26:32 -0400 |
commit | 7c2510120e9b43b0caf32c3786a6ab831f7d9e87 (patch) | |
tree | 475d9d6ac58c645628263125b67dd9d67f2df267 /drivers/net/wireless/iwlegacy | |
parent | 1c1bdd324cd50ac55f7ebf95ef249d946c6e4361 (diff) | |
download | blackbird-op-linux-7c2510120e9b43b0caf32c3786a6ab831f7d9e87.tar.gz blackbird-op-linux-7c2510120e9b43b0caf32c3786a6ab831f7d9e87.zip |
iwlegacy: fix BUG_ON(info->control.rates[0].idx < 0)
When trying to connect to 5GHz we can provide negative index to
mac80211 what trigger BUG_ON. Reason of iwl-3945-rs malfunction
on 5GHz is unknown and needs further investigation. For now, to
do not trigger a bug, correct value and just print WARNING.
Address bug:
https://bugzilla.redhat.com/show_bug.cgi?id=730653
Reported-and-tested-by: Jan Teichmann <jan.teichmann@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-3945-rs.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c index 977bd2477c6a..164bcae821f8 100644 --- a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c @@ -822,12 +822,15 @@ static void iwl3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, out: - rs_sta->last_txrate_idx = index; - if (sband->band == IEEE80211_BAND_5GHZ) - info->control.rates[0].idx = rs_sta->last_txrate_idx - - IWL_FIRST_OFDM_RATE; - else + if (sband->band == IEEE80211_BAND_5GHZ) { + if (WARN_ON_ONCE(index < IWL_FIRST_OFDM_RATE)) + index = IWL_FIRST_OFDM_RATE; + rs_sta->last_txrate_idx = index; + info->control.rates[0].idx = index - IWL_FIRST_OFDM_RATE; + } else { + rs_sta->last_txrate_idx = index; info->control.rates[0].idx = rs_sta->last_txrate_idx; + } IWL_DEBUG_RATE(priv, "leave: %d\n", index); } |