Clients may not filling magic field, thus causing garbage
to be passed as a device address.
Limit that to maximum SMbus address.
Fixes:
ce4e8d418097 ("net/atlantic: implement EEPROM get/set")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
eeprom->data == NULL)
return -EINVAL;
+ if (eeprom->magic > 0x7F)
+ return -EINVAL;
+
if (eeprom->magic)
dev_addr = eeprom->magic;
eeprom->data == NULL)
return -EINVAL;
+ if (eeprom->magic > 0x7F)
+ return -EINVAL;
+
if (eeprom->magic)
dev_addr = eeprom->magic;