Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons. Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52958 )
Change subject: buspirate_spi.c: Refactor singleton states into reentrant pattern ......................................................................
Patch Set 3:
(2 comments)
File buspirate_spi.c:
https://review.coreboot.org/c/flashrom/+/52958/comment/a8785a3c_e81c42ef PS3, Line 58: unsigned char **bp_commbuf
does this actually need double indirection?
I think so, because the pointer can change after realloc (and the size of the buffer can also change) - but please correct me if I am wrong.
https://review.coreboot.org/c/flashrom/+/52958/comment/ca94ff25_803e2b85 PS3, Line 221: unsigned char *const bp_commbuf = bp_data->bp_commbuf;
perhaps just move this up a few lines to the functions preamble so that the branch line above can be […]
I thought that buspirate_commbuf_grow can change the pointer, and I can have this local variable as constant pointer after buspirate_commbuf_grow. Both your comments have the same answer, depending on whether realloc can change the pointer?