Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/47655 )
Change subject: it85spi.c: Refactor singleton states into reentrant pattern ......................................................................
Patch Set 2: Code-Review+1
(4 comments)
https://review.coreboot.org/c/flashrom/+/47655/2/it85spi.c File it85spi.c:
https://review.coreboot.org/c/flashrom/+/47655/2/it85spi.c@76 PS2, Line 76: it85_data call this `it85spi_data`
https://review.coreboot.org/c/flashrom/+/47655/2/it85spi.c@222 PS2, Line 222: : return 0 you need to `free(data);` before the return since it is a heap allocation.
https://review.coreboot.org/c/flashrom/+/47655/2/it85spi.c@312 PS2, Line 312: msg_perr("Out of memory!\n"); : return 1; : } ``` msg_perr("Unable to allocate space for extra SPI master data.\n"); return SPI_GENERIC_ERROR; } ```
https://review.coreboot.org/c/flashrom/+/47655/2/it85spi.c@315 PS2, Line 315: data->it85xx_scratch_rom_reenter = 0; I know the original code doesn't do it but its probably worth initialising the rest as well.