ath9k: fix crash in ath_update_survey_stats
PATCH 1/1 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 <[email protected]>
---
drivers/net/wireless/ath/ath9k/main.c +3 -0
@@ -183,6 +183,9 @@ static void ath_update_survey_stats(strustruct ath_cycle_counters *cc = &common->cc_survey;unsigned int div = common->clockrate *1000 ; +if (!ah->curchan) +return ; +if (ah->power_mode ==ATH9K_PM_AWAKE )ath_hw_cycle_counters_update (common);