mirror of
https://review.coreboot.org/flashrom.git
synced 2025-09-13 16:51:58 +02:00
Check verify flag in prepare_flash_access before erase operation
The last argument in `prepare_flash_access` function indicates whether verify operation was requested. This information is in the flag `verify_after_write` in flash context, so lets pass it to the function. Previously, the last argument which is called `verify_it` was always `false`. This hasn't been detected because in the current implementation of `prepare_flash_access`, `verify_it` is always checked together with `erase_it`, the latter was passed always true. `verify_it` being false is wrong because we have a flag to decide about verification. Also this false value contradicts reality, because erase operation ignores the flag and always verifies (this has always been the case even with earlier implementations of erase logic). Additional context is in the next commit and ticket https://ticket.coreboot.org/issues/520 Change-Id: Idd7526084e4942b7adbbab57a62f7de84b4a4bb5 Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/88733 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
@@ -1890,7 +1890,7 @@ void finalize_flash_access(struct flashctx *const flash)
|
|||||||
|
|
||||||
int flashrom_flash_erase(struct flashctx *const flashctx)
|
int flashrom_flash_erase(struct flashctx *const flashctx)
|
||||||
{
|
{
|
||||||
if (prepare_flash_access(flashctx, false, false, true, false))
|
if (prepare_flash_access(flashctx, false, false, true, flashctx->flags.verify_after_write))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
const int ret = erase_by_layout(flashctx);
|
const int ret = erase_by_layout(flashctx);
|
||||||
|
Reference in New Issue
Block a user