Commit 86fbe17d authored by Pavel Roskin's avatar Pavel Roskin Committed by John W. Linville
Browse files

ath5k: validate mode in ath5k_ani_init() before trying to set it

Signed-off-by: default avatarPavel Roskin <>
Signed-off-by: default avatarJohn W. Linville <>
parent 21394754
......@@ -630,6 +630,11 @@ ath5k_ani_init(struct ath5k_hw *ah, enum ath5k_ani_mode mode)
if (ah->ah_version < AR5K_AR5212)
if (mode < ATH5K_ANI_MODE_OFF || mode > ATH5K_ANI_MODE_AUTO) {
ATH5K_ERR(ah->ah_sc, "ANI mode %d out of range", mode);
/* clear old state information */
memset(&ah->ah_sc->ani_state, 0, sizeof(ah->ah_sc->ani_state));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment