aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-10-20 09:59:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-25 14:43:14 -0400
commit0845735e2d1e4c177076d4bc2d841d9f77e95131 (patch)
treed45bf79b448f0eef91d1803f113df9343afef820 /drivers/net
parent2d3fca180710c6832de22c44155ce6a3a4953c6b (diff)
ath9k: fix crash in ath_update_survey_stats
If ah->curchan is uninitialized, the channel index is bogus, which leads to invalid memory access when the cycle counters are updated. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 3ff0e476c2b3..9679b3191975 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -182,6 +182,9 @@ static void ath_update_survey_stats(struct ath_softc *sc)
182 struct ath_cycle_counters *cc = &common->cc_survey; 182 struct ath_cycle_counters *cc = &common->cc_survey;
183 unsigned int div = common->clockrate * 1000; 183 unsigned int div = common->clockrate * 1000;
184 184
185 if (!ah->curchan)
186 return;
187
185 if (ah->power_mode == ATH9K_PM_AWAKE) 188 if (ah->power_mode == ATH9K_PM_AWAKE)
186 ath_hw_cycle_counters_update(common); 189 ath_hw_cycle_counters_update(common);
187 190