Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

parent 21394754
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -630,6 +630,11 @@ ath5k_ani_init(struct ath5k_hw *ah, enum ath5k_ani_mode mode)
	if (ah->ah_version < AR5K_AR5212)
		return;

	if (mode < ATH5K_ANI_MODE_OFF || mode > ATH5K_ANI_MODE_AUTO) {
		ATH5K_ERR(ah->ah_sc, "ANI mode %d out of range", mode);
		return;
	}

	/* clear old state information */
	memset(&ah->ah_sc->ani_state, 0, sizeof(ah->ah_sc->ani_state));