Attention is currently required from: Felix Singer, Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
Alexander Goncharov has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73039 )
Change subject: flashrom: rewrite flashbuses_to_text() ......................................................................
Patch Set 5:
(3 comments)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/73039/comment/af0ed7f2_7316e0a5 PS4, Line 918: Get
You can leave "return" in this case, I think return sounds good here.
Done
https://review.coreboot.org/c/flashrom/+/73039/comment/0ceb87d6_6b4fcc95 PS4, Line 924: char *ret, *ptr;
I am going to ask silly question: why do you need both? […]
Hmm... `strcat_realloc()` may return NULL. In such case `ret = strcat_realloc(ret, ...);` we will lose the pointer to the allocated space => memory leak
https://review.coreboot.org/c/flashrom/+/73039/comment/df5da46d_f8e86b9f PS4, Line 938: if (bustype == BUS_NONSPI) : return strdup("Non-SPI"); : if (bustype == BUS_NONE) : return strdup(bustypes[bustype]);
These first two cases (BUS_NONSPI and BUS_NONE) are specially handled in the code, I understand why, […]
You're definitely right, your suggestion will simplify everything, thanks! Done.