From: Sujith Manoharan Date: Tue, 14 Jan 2014 03:52:36 +0000 (+0530) Subject: ath9k: Fix error reported by smatch X-Git-Tag: v4.9.8~7055^2~3^2^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1908861f2fb072446eabbdc4a01c3bec40ed2f7c;p=platform%2Fkernel%2Flinux-rpi3.git ath9k: Fix error reported by smatch debug_sta.c: ath_debug_rate_stats() error: buffer overflow 'rstats->ht_stats' 24 <= 24 Cc: Dan Carpenter Signed-off-by: Sujith Manoharan Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/debug_sta.c b/drivers/net/wireless/ath/ath9k/debug_sta.c index d33cc88..d76e6e0 100644 --- a/drivers/net/wireless/ath/ath9k/debug_sta.c +++ b/drivers/net/wireless/ath/ath9k/debug_sta.c @@ -128,7 +128,7 @@ void ath_debug_rate_stats(struct ath_softc *sc, rxs = IEEE80211_SKB_RXCB(skb); if (IS_HT_RATE(rs->rs_rate)) { - if (rxs->rate_idx > ARRAY_SIZE(rstats->ht_stats)) + if (rxs->rate_idx >= ARRAY_SIZE(rstats->ht_stats)) goto exit; if (rxs->flag & RX_FLAG_40MHZ)