summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2016-03-07 10:02:46 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-03-08 13:56:40 -0800
commit554ecc6b9d4d054483d9b7fc6e8df84ca1dcdba6 (patch)
tree3b843916bd78833c55a8c505fcde96074d5cfc47
parent866e8499578263b12a712a06eeda9d7a873a0702 (diff)
downloadchrome-ec-554ecc6b9d4d054483d9b7fc6e8df84ca1dcdba6.tar.gz
util/iteflash: Return error on all verify failures
BUG=None TEST=`make buildall -j` BRANCH=None Change-Id: Iefc8e1eaf1e5d7c8533d8497c227c8c16eb2c06d Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/331200 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--util/iteflash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/iteflash.c b/util/iteflash.c
index 3a0e2257da..6baab8f662 100644
--- a/util/iteflash.c
+++ b/util/iteflash.c
@@ -885,7 +885,7 @@ int write_flash(struct ftdi_context *ftdi, const char *filename,
int verify_flash(struct ftdi_context *ftdi, const char *filename,
uint32_t offset)
{
- int res = 0;
+ int res;
int file_size;
FILE *hnd;
uint8_t *buffer = malloc(flash_size);
@@ -906,6 +906,7 @@ int verify_flash(struct ftdi_context *ftdi, const char *filename,
file_size = fread(buffer, 1, flash_size, hnd);
if (file_size <= 0) {
fprintf(stderr, "Cannot read %s\n", filename);
+ res = -EIO;
goto exit;
}
fclose(hnd);