board: ge: common: vpd: Fix read_i2c_vpd return value

If i2c_eeprom_size fails, the error value is stored in
variable size and not ret.
Also, this commit fixes printing the error value.

Signed-off-by: Francois Berder <fberder@outlook.fr>
This commit is contained in:
Francois Berder
2026-01-31 12:29:01 +01:00
committed by Fabio Estevam
parent 98d6f42fc5
commit 944e577827

View File

@@ -215,8 +215,8 @@ int read_i2c_vpd(struct vpd_cache *cache,
size = i2c_eeprom_size(dev);
if (size < 0) {
printf("Unable to get size of eeprom: %d\n", ret);
return ret;
printf("Unable to get size of eeprom: %d\n", size);
return size;
}
data = malloc(size);