aboutsummaryrefslogtreecommitdiff
path: root/tools/imx8mimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/imx8mimage.c')
-rw-r--r--tools/imx8mimage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c
index 11e40cc..4eed683 100644
--- a/tools/imx8mimage.c
+++ b/tools/imx8mimage.c
@@ -271,7 +271,7 @@ static void copy_file(int ifd, const char *datafile, int pad, int offset,
if (ptr == MAP_FAILED) {
fprintf(stderr, "Can't read %s: %s\n",
datafile, strerror(errno));
- exit(EXIT_FAILURE);
+ goto err_mmap;
}
size = sbuf.st_size - datafile_offset;
@@ -311,6 +311,7 @@ static void copy_file(int ifd, const char *datafile, int pad, int offset,
}
munmap((void *)ptr, sbuf.st_size);
+err_mmap:
close(dfd);
}