Skip to contentSkip to conversation

wireless: beyond ARRAY_SIZE of intf->crypto_stats

PATCH In review Roel Kluin 2 participants 2 messages May 20, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 wireless: beyond ARRAY_SIZE of intf->crypto_stats

Do not go beyond ARRAY_SIZE of intf->crypto_stats

---

drivers/net/wireless/rt2x00/rt2x00debug.c +1 -1
index 07d378e..7b3ee8c 100644
@@ -138,7 +138,7 @@ void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
 
 	if (cipher == CIPHER_TKIP_NO_MIC)
 		cipher = CIPHER_TKIP;
-	if (cipher == CIPHER_NONE || cipher > CIPHER_MAX)
+	if (cipher == CIPHER_NONE || cipher >= CIPHER_MAX)
 		return;
 
 	/* Remove CIPHER_NONE index */
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Roel Kluin

Do not go beyond ARRAY_SIZE of intf->crypto_stats

I really hope the previous code never resulted in a crash, since then I would have to look into strange values coming from the hardware. ;)

Thanks.

Quoted 19 lines

---

drivers/net/wireless/rt2x00/rt2x00debug.c +1 -2
index 07d378e..7b3ee8c 100644
@@ -138,7 +138,7 @@ void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
 
 	if (cipher == CIPHER_TKIP_NO_MIC)
 		cipher = CIPHER_TKIP;
-	if (cipher == CIPHER_NONE || cipher > CIPHER_MAX)
+	if (cipher == CIPHER_NONE || cipher >= CIPHER_MAX)
 		return;
 
 	/* Remove CIPHER_NONE index */
--

To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html