ath9k: off by one in ath9k_hw_nvram_read_array()

The > should be >= or we read one space beyond the end of the array.

Fixes: ab5c4f71d8 ("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>
This commit is contained in:
Dan Carpenter 2017-04-06 08:12:20 +03:00 committed by Kalle Valo
parent 3161adddf3
commit b7dcf68f38
1 changed files with 1 additions and 1 deletions

View 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];