summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorroel <roel.kluin@gmail.com>2011-04-10 23:09:50 +0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-13 00:59:30 +0400
commit0f8e94d2ae4f7966d09c8105ccabb3b3d8238a4d (patch)
tree3a3509a24f8fff5bf33f23b13f0b2db5f3bceb1b /drivers
parentc266c71a9cbdccb40fb6f4c05d4ddaa6226e5eba (diff)
downloadlinux-0f8e94d2ae4f7966d09c8105ccabb3b3d8238a4d.tar.xz
ath9k_hw: index out of bounds
Check whether index is within bounds before testing the element Both spurChans arrays in modalHeader5G and modalHeader2G have 5 elements, AR_EEPROM_MODAL_SPURS is defined 5. So unless a break occurs, in the last iteration (i=5) we tried to access spurChansPtr[5] before testing whether i was within bounds. Fix this. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index eb250d6b8038..93398de0bf67 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -401,7 +401,7 @@ static void ar9003_hw_spur_mitigate_ofdm(struct ath_hw *ah,
ar9003_hw_spur_ofdm_clear(ah);
- for (i = 0; spurChansPtr[i] && i < 5; i++) {
+ for (i = 0; i < AR_EEPROM_MODAL_SPURS && spurChansPtr[i]; i++) {
freq_offset = FBIN2FREQ(spurChansPtr[i], mode) - synth_freq;
if (abs(freq_offset) < range) {
ar9003_hw_spur_ofdm_work(ah, chan, freq_offset);