1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

erasure_layout.c: Fix incorrect return value in erase_write

On failure of erasefn in erase_write it didn't set the error value in
ret which caused send success status as return value.

Change-Id: Ia3bd5fd250dcd0a03f0281c478b9bacb71872f31
Signed-off-by: Aarya Chaumal <aarya.chaumal@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/74882
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
This commit is contained in:
Aarya Chaumal 2023-05-02 23:06:56 +05:30 committed by Anastasia Klimchuk
parent 70a38170b9
commit 3d5c9a5cea

View File

@ -328,9 +328,12 @@ int erase_write(struct flashctx *const flashctx, chipoff_t region_start, chipoff
addr, addr + len - 1);
free(region.name);
if (erasefn(flashctx, addr, len))
if (erasefn(flashctx, addr, len)) {
ret = -1;
goto _end;
}
if (check_erased_range(flashctx, addr, len)) {
ret = - 1;
msg_cerr("ERASE FAILED!\n");
goto _end;
}