diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 6e3d838..4f8c905 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -190,6 +190,19 @@ static int ath_update_survey_stats(struct ath_softc *sc) if (!ah->curchan) return -1; + /* just to make pos does not exceeds ATH9K_NUM_CHANNELS - 1 */ + if (pos > 37) { + WARN_ON(1); + printk("\npos is %d index out of bounds!!! in %s", pos, __func__); + return -1; + } + + if (!survey) { + WARN_ON(1); + printk("\nNULL pointer for survey !!! in %s", __func__); + return -1; + } + if (ah->power_mode == ATH9K_PM_AWAKE) ath_hw_cycle_counters_update(common);