diff mbox

[U-Boot,01/14] mkimage: Fix munmap() call when importing data

Message ID 1458135945-13385-2-git-send-email-sjg@chromium.org
State Accepted
Commit 9cff2d1e39bca4e456a61a3395611cafe2f8969e
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass March 16, 2016, 1:45 p.m. UTC
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>
---

 tools/fit_image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini March 17, 2016, 2:08 a.m. UTC | #1
On Wed, Mar 16, 2016 at 07:45:31AM -0600, Simon Glass wrote:

> 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>
Tom Rini March 23, 2016, 1:59 a.m. UTC | #2
On Wed, Mar 16, 2016 at 07:45:31AM -0600, Simon Glass wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox

Patch

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 @@  static int fit_import_data(struct image_tool_params *params, const char *fname)
 		}
 	}
 
-	munmap(fdt, sbuf.st_size);
+	munmap(old_fdt, sbuf.st_size);
 	close(fd);
 
 	/* Pack the FDT and place the data after it */