Skip to content

Commit

Permalink
ath9k: fix crash in ath_update_survey_stats
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Oct 25, 2010
1 parent 2d3fca1 commit 0845735
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 0845735

Please sign in to comment.