ath: Fix ath_dbg access beyond array bound
ar9300RateSize is not necessarily a power of 4. Change ar9003_hw_set_target_power_eeprom to print the targetPowerValT2 array one per line. ath9k_hw_ar9300_set_txpower repeated the output 4 times per line, change it to print the targetPowerValT2 value one per line. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
226afe68fd
commit
a1cbc7a889
@@ -4089,22 +4089,9 @@ static void ar9003_hw_set_target_power_eeprom(struct ath_hw *ah, u16 freq,
|
|||||||
ar9003_hw_eeprom_get_ht40_tgt_pwr(ah, HT_TARGET_RATE_23, freq,
|
ar9003_hw_eeprom_get_ht40_tgt_pwr(ah, HT_TARGET_RATE_23, freq,
|
||||||
is2GHz) + ht40PowerIncForPdadc;
|
is2GHz) + ht40PowerIncForPdadc;
|
||||||
|
|
||||||
while (i < ar9300RateSize) {
|
for (i = 0; i < ar9300RateSize; i++) {
|
||||||
ath_dbg(common, ATH_DBG_EEPROM,
|
|
||||||
"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
|
|
||||||
i++;
|
|
||||||
|
|
||||||
ath_dbg(common, ATH_DBG_EEPROM,
|
|
||||||
"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
|
|
||||||
i++;
|
|
||||||
|
|
||||||
ath_dbg(common, ATH_DBG_EEPROM,
|
|
||||||
"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
|
|
||||||
i++;
|
|
||||||
|
|
||||||
ath_dbg(common, ATH_DBG_EEPROM,
|
ath_dbg(common, ATH_DBG_EEPROM,
|
||||||
"TPC[%02d] 0x%08x\n", i, targetPowerValT2[i]);
|
"TPC[%02d] 0x%08x\n", i, targetPowerValT2[i]);
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4692,17 +4679,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
|
|||||||
|
|
||||||
for (i = 0; i < ar9300RateSize; i++) {
|
for (i = 0; i < ar9300RateSize; i++) {
|
||||||
ath_dbg(common, ATH_DBG_EEPROM,
|
ath_dbg(common, ATH_DBG_EEPROM,
|
||||||
"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
|
"TPC[%02d] 0x%08x\n", i, targetPowerValT2[i]);
|
||||||
i++;
|
|
||||||
ath_dbg(common, ATH_DBG_EEPROM,
|
|
||||||
"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
|
|
||||||
i++;
|
|
||||||
ath_dbg(common, ATH_DBG_EEPROM,
|
|
||||||
"TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
|
|
||||||
i++;
|
|
||||||
ath_dbg(common, ATH_DBG_EEPROM,
|
|
||||||
"TPC[%02d] 0x%08x\n\n", i, targetPowerValT2[i]);
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user