]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
ath9k: fix crash in ath_update_survey_stats
authorFelix Fietkau <nbd@openwrt.org>
Wed, 20 Oct 2010 13:59:28 +0000 (15:59 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 25 Oct 2010 18:43:14 +0000 (14:43 -0400)
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>
drivers/net/wireless/ath/ath9k/main.c

index 3ff0e476c2b3d7ad4cc209360042c6c5097d87a8..9679b31919751e316391f7d79541b89e74d05d06 100644 (file)
@@ -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);