From db5b4f7ae3901fdc48c5b988fc2a5e0cb4ec1870 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Thu, 26 Feb 2009 23:44:31 +0100 Subject: 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 Cc: Nick Kossifidis Cc: Luis R. Rodriguez Cc: Bob Copeland Signed-off-by: John W. Linville diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index bce825b..f7c424d 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) static inline int ath5k_hw_to_driver_rix(struct ath5k_softc *sc, int hw_rix) { - WARN_ON(hw_rix < 0 || hw_rix > AR5K_MAX_RATES); + WARN(hw_rix < 0 || hw_rix >= AR5K_MAX_RATES, + "hw_rix out of bounds: %x\n", hw_rix); return sc->rate_idx[sc->curband->band][hw_rix]; } -- cgit v0.10.2