diff options
-rw-r--r-- | util/iteflash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/iteflash.c b/util/iteflash.c index 3011600f3f..701c9dd2a5 100644 --- a/util/iteflash.c +++ b/util/iteflash.c @@ -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); |