Attention is currently required from: Nico Huber. Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52685 )
Change subject: ene_lpc.c: Untangle successful vs failed init paths ......................................................................
Patch Set 3:
(1 comment)
File ene_lpc.c:
https://review.coreboot.org/c/flashrom/+/52685/comment/99dbdc13_fd7eef24 PS3, Line 582: return 1;
It should fall through instead, right?
No because ene_leave_flash_mode frees ctx_data and there's nothing more to do after it. The same flow is in mec1308. One thing ene and mec have in common is that ctx_data is allocated at the very beginning of init function, means all error paths need to free it. Ideally, I want data to be allocated at the very end of init function, just before register_shutdown, and use local variables in most of init function body. I did it in some places where it was trivial, but for ene and mec that would be more diffs and I think to have a dedicated patch for this change. (from my memory dummy has the same issue: data allocated in the beginning of init, and some error paths forget to free it).