aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-02-26 17:44:31 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 14:39:32 -0500
commitdb5b4f7ae3901fdc48c5b988fc2a5e0cb4ec1870 (patch)
tree5a542aaee237726c607c3bf7a519d4479cd2454f /drivers/net/wireless
parent3f53dd64f192450cb331c0fecfc26ca952fb242f (diff)
ath5k: fix hw rate index condition
Make sure we print out a warning when the index is out of bounds, i.e. even on hw_rix == AR5K_MAX_RATES. Also change to WARN and print text with the reported hw_rix. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Nick Kossifidis <mickflemm@gmail.com> Cc: Luis R. Rodriguez <lrodriguez@atheros.com> Cc: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath5k/base.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index bce825b9ff1b..f7c424dcac66 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1100,7 +1100,8 @@ ath5k_mode_setup(struct ath5k_softc *sc)
1100static inline int 1100static inline int
1101ath5k_hw_to_driver_rix(struct ath5k_softc *sc, int hw_rix) 1101ath5k_hw_to_driver_rix(struct ath5k_softc *sc, int hw_rix)
1102{ 1102{
1103 WARN_ON(hw_rix < 0 || hw_rix > AR5K_MAX_RATES); 1103 WARN(hw_rix < 0 || hw_rix >= AR5K_MAX_RATES,
1104 "hw_rix out of bounds: %x\n", hw_rix);
1104 return sc->rate_idx[sc->curband->band][hw_rix]; 1105 return sc->rate_idx[sc->curband->band][hw_rix];
1105} 1106}
1106 1107