mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00
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 <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
2d3fca1807
commit
0845735e2d
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue