]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ath9k: off by one in ath9k_hw_nvram_read_array()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 6 Apr 2017 05:12:20 +0000 (08:12 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 19 Apr 2017 13:57:41 +0000 (16:57 +0300)
The > should be >= or we read one space beyond the end of the array.

Fixes: ab5c4f71d8c7 ("ath9k: allow to load EEPROM content via firmware API")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath9k/eeprom.c

index fb80ec86e53d07690ea186148305a18bcc7fdc9e..6ccf248145141db26f931d83b1a8327d656b516f 100644 (file)
@@ -112,7 +112,7 @@ void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
 static bool ath9k_hw_nvram_read_array(u16 *blob, size_t blob_size,
                                      off_t offset, u16 *data)
 {
-       if (offset > blob_size)
+       if (offset >= blob_size)
                return false;
 
        *data =  blob[offset];