ath5k: validate mode in ath5k_ani_init() before trying to set it
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
21394754bc
commit
86fbe17d7f
1 changed files with 5 additions and 0 deletions
|
@ -630,6 +630,11 @@ ath5k_ani_init(struct ath5k_hw *ah, enum ath5k_ani_mode mode)
|
||||||
if (ah->ah_version < AR5K_AR5212)
|
if (ah->ah_version < AR5K_AR5212)
|
||||||
return;
|
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 */
|
/* clear old state information */
|
||||||
memset(&ah->ah_sc->ani_state, 0, sizeof(ah->ah_sc->ani_state));
|
memset(&ah->ah_sc->ani_state, 0, sizeof(ah->ah_sc->ani_state));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue