mkimage: Fix munmap() call when importing data
The munmap() call unmaps the wrong memory buffer. Fix it.
Reported-by: Coverity (CID: 138505)
Reported-by: Coverity (CID: 138495)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/tools/fit_image.c b/tools/fit_image.c
index 3ecc88f..2c8d92f 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -517,7 +517,7 @@
}
}
- munmap(fdt, sbuf.st_size);
+ munmap(old_fdt, sbuf.st_size);
close(fd);
/* Pack the FDT and place the data after it */