Commit 2c30708e authored by Dan Carpenter's avatar Dan Carpenter Committed by Ben Hutchings

ath9k: off by one in ath9k_hw_nvram_read_array()

commit b7dcf68f upstream.

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

Fixes: ab5c4f71 ("ath9k: allow to load EEPROM content via firmware API")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 3881e59f
...@@ -118,7 +118,7 @@ static bool ath9k_hw_nvram_read_blob(struct ath_hw *ah, u32 off, ...@@ -118,7 +118,7 @@ static bool ath9k_hw_nvram_read_blob(struct ath_hw *ah, u32 off,
{ {
u16 *blob_data; u16 *blob_data;
if (off * sizeof(u16) > ah->eeprom_blob->size) if (off * sizeof(u16) >= ah->eeprom_blob->size)
return false; return false;
blob_data = (u16 *)ah->eeprom_blob->data; blob_data = (u16 *)ah->eeprom_blob->data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment