summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2011-07-09 00:17:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-11 15:02:15 -0400
commit86fbe17d7f0856f4111e1ceaf3f5c399315fb4e7 (patch)
tree3eee90c4da98dac187f8bbe1f3c175976e35672b /drivers/net/wireless/ath
parent21394754bcca59aeb4a0b74c95c0220bb727808f (diff)
downloadtalos-obmc-linux-86fbe17d7f0856f4111e1ceaf3f5c399315fb4e7.tar.gz
talos-obmc-linux-86fbe17d7f0856f4111e1ceaf3f5c399315fb4e7.zip
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>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath5k/ani.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ani.c b/drivers/net/wireless/ath/ath5k/ani.c
index a08f17318e63..b88d10c3b9e0 100644
--- a/drivers/net/wireless/ath/ath5k/ani.c
+++ b/drivers/net/wireless/ath/ath5k/ani.c
@@ -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));
OpenPOWER on IntegriCloud