wireless: beyond ARRAY_SIZE of intf->crypto_stats
PATCH 1/1 wireless: beyond ARRAY_SIZE of intf->crypto_stats
Do not go beyond ARRAY_SIZE of intf->crypto_stats
Signed-off-by Roel Kluin <[email protected]>
---
drivers/net/wireless/rt2x00/rt2x00debug.c +1 -1
@@ -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 */
Quoted 3 lines · Roel Kluin
Do not go beyond
ARRAY_SIZEofintf->crypto_statsSigned-off-by Roel Kluin <[email protected]>
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.
Acked-by Ivo van Doorn <[email protected]>
Quoted 19 lines
---
drivers/net/wireless/rt2x00/rt2x00debug.c +1
-2@@ -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