Skip to contentSkip to conversation

ath9k: Fix error reported by smatch

PATCH New Sujith Manoharan 1 participant 1 message Jan 14, 2014 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: Fix error reported by smatch

From: Sujith Manoharan <[email protected]>

debug_sta.c: ath_debug_rate_stats() error: buffer overflow 'rstats->ht_stats' 24 <= 24

---
 drivers/net/wireless/ath/ath9k/debug_sta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/debug_sta.c +1 -1
index d33cc88..d76e6e0 100644
@@ -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)
Signature · 1 line
1.8.5.2