From: Felix Fietkau Date: Wed, 20 Oct 2010 13:59:28 +0000 (+0200) Subject: ath9k: fix crash in ath_update_survey_stats X-Git-Tag: firefly_0821_release~7613^2~3176^2~7^2~92 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0845735e2d1e4c177076d4bc2d841d9f77e95131;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: John W. Linville --- 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) struct 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);