Skip to contentSkip to conversation

ath9k: fix crash in ath_update_survey_stats

PATCH New Felix Fietkau 1 participant 1 message Oct 20, 2010 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

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.

---

drivers/net/wireless/ath/ath9k/main.c +3 -0
@@ -183,6 +183,9 @@ static void ath_update_survey_stats(stru
 	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);