There is no need to keep fru_content around. Free this space.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
eeprom_size);
if (ret) {
debug("%s: I2C EEPROM read failed\n", __func__);
- free(fru_content);
- return ret;
+ goto end;
}
printf("Xilinx I2C FRU format at %s:\n", name);
ret = fru_display(0);
if (ret) {
printf("FRU format decoding failed.\n");
- return ret;
+ goto end;
}
if (desc->header == EEPROM_HEADER_MAGIC) {
debug("Information already filled\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto end;
}
/* It is clear that FRU was captured and structures were filled */
sizeof(desc->serial));
desc->header = EEPROM_HEADER_MAGIC;
- return 0;
+end:
+ free(fru_content);
+ return ret;
}
static bool xilinx_detect_fru(u8 *buffer)