Attention is currently required from: Edward O'Callaghan, Angel Pons, Daniel Campello, Anastasia Klimchuk, Peter Marheine. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/33543 )
Change subject: layout: Introduce flashrom_layout_empty() ......................................................................
Patch Set 3:
(2 comments)
File libflashrom.h:
https://review.coreboot.org/c/flashrom/+/33543/comment/6393345c_d19adf4c PS3, Line 111: int flashrom_layout_empty(struct flashrom_layout **, unsigned int count);
flashrom_layout_new might be clearer, since it's not obvious whether 'empty' means it will create a […]
Full ack. I also wondered about this during rebase. :)
File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/33543/comment/363fc92e_217af8c4 PS3, Line 353: flashrom_layout_release(second_flashctx.default_layout);
It seems error-prone to require the caller to clean up the partially-initialized second_flashctx her […]
It's actually fully initialized. In a follow-up I add the missing `free(second_flashctx.chip)`. We could add an interim function that does both, I suppose. But in the long run we should probably move the allocation of the flash context into probe_flash(), then flashrom_flash_release() could always be used. What do you think? (would probably be easier if we'd make the classic CLI use the libflashrom API first)
The underlying problem is that the probe_flash() API mixes pre- allocated with dynamically allocated things :-(