mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-29 10:00:51 +00:00
util/iteflash.c: make sure that the file is closed
An insignificant bug, but Coverity complains about it. Reduce the cognitive load by making sure that file is closed in time. BUG=none BRANCH=none TEST=none Change-Id: I2efbe136f4991cf829b95568eef22eb7b2d1a8c6 Found-by: Coverity Scan #141758 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/702304 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Chris Ching <chingcodes@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
57ae0b0f18
commit
828da3d556
@@ -916,12 +916,12 @@ int verify_flash(struct ftdi_context *ftdi, const char *filename,
|
||||
}
|
||||
|
||||
file_size = fread(buffer, 1, flash_size, hnd);
|
||||
fclose(hnd);
|
||||
if (file_size <= 0) {
|
||||
fprintf(stderr, "Cannot read %s\n", filename);
|
||||
res = -EIO;
|
||||
goto exit;
|
||||
}
|
||||
fclose(hnd);
|
||||
|
||||
printf("Verify %d bytes at 0x%08x\n", file_size, offset);
|
||||
res = command_read_pages(ftdi, offset, flash_size, buffer2);
|
||||
|
||||
Reference in New Issue
Block a user