diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-08-07 17:50:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:46 -0400 |
commit | 73f57f8398ed6cba82f9856e20d94d71e6edb3e2 (patch) | |
tree | 132627d29a3a264b7ea774f5f17bdad87e01a962 | |
parent | 5bf6fcc2bbfb90d997f88c969f1ceee35d064a24 (diff) |
ath9k: Fix read buffer overflow
Prevent a read of powInfo[-1] in the first iteration.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c index 958948bc73fd..b6e52d0f8c48 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.c +++ b/drivers/net/wireless/ath/ath9k/eeprom.c | |||
@@ -143,10 +143,10 @@ void ath9k_hw_get_legacy_target_powers(struct ath_hw *ah, | |||
143 | IS_CHAN_2GHZ(chan))) { | 143 | IS_CHAN_2GHZ(chan))) { |
144 | matchIndex = i; | 144 | matchIndex = i; |
145 | break; | 145 | break; |
146 | } else if ((freq < ath9k_hw_fbin2freq(powInfo[i].bChannel, | 146 | } else if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel, |
147 | IS_CHAN_2GHZ(chan))) && | 147 | IS_CHAN_2GHZ(chan)) && i > 0 && |
148 | (freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel, | 148 | freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel, |
149 | IS_CHAN_2GHZ(chan)))) { | 149 | IS_CHAN_2GHZ(chan))) { |
150 | lowIndex = i - 1; | 150 | lowIndex = i - 1; |
151 | break; | 151 | break; |
152 | } | 152 | } |
@@ -198,10 +198,10 @@ void ath9k_hw_get_target_powers(struct ath_hw *ah, | |||
198 | matchIndex = i; | 198 | matchIndex = i; |
199 | break; | 199 | break; |
200 | } else | 200 | } else |
201 | if ((freq < ath9k_hw_fbin2freq(powInfo[i].bChannel, | 201 | if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel, |
202 | IS_CHAN_2GHZ(chan))) && | 202 | IS_CHAN_2GHZ(chan)) && i > 0 && |
203 | (freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel, | 203 | freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel, |
204 | IS_CHAN_2GHZ(chan)))) { | 204 | IS_CHAN_2GHZ(chan))) { |
205 | lowIndex = i - 1; | 205 | lowIndex = i - 1; |
206 | break; | 206 | break; |
207 | } | 207 | } |