Anastasia Klimchuk submitted this change.
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>
---
M erasure_layout.c
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/erasure_layout.c b/erasure_layout.c
index a802ae4..108fea4 100644
--- a/erasure_layout.c
+++ b/erasure_layout.c
@@ -328,9 +328,12 @@
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;
}
To view, visit change 74882. To unsubscribe, or for help writing mail filters, visit settings.