Attention is currently required from: Nikolai Artemiev.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69517 )
Change subject: flashrom.c: Supplement `chip->unlock()` calls with wp unlocking ......................................................................
Patch Set 7: Code-Review+1
(4 comments)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/69517/comment/bc4a9eb2_5e70485c PS7, Line 1687: if (ret != FLASHROM_WP_OK) : return -1; : : return 0; ternary operator seems more concise here.
https://review.coreboot.org/c/flashrom/+/69517/comment/c7e4c8a3_9ca3c80f PS7, Line 1695: struct flashrom_wp_cfg *original_wp_cfg = NULL; : struct flashrom_wp_cfg *unlocked_cfg = NULL; Do these need to be initialised, if done unnecessarily it can obscure static analysis.
https://review.coreboot.org/c/flashrom/+/69517/comment/4a56e72b_9bdf3531 PS7, Line 1696: unlocked_cfg be consistent `unlocked_wp_cfg`
https://review.coreboot.org/c/flashrom/+/69517/comment/311ffee1_8cb40d3c PS7, Line 1708: return -1; are you leaking `original_wp_cfg` on the return here?
This function could perhaps do with some goto's to clean up the error path resource management complexity.