Răsfoiți Sursa

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>
Simon Glass 9 ani în urmă
părinte
comite
9cff2d1e39
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      tools/fit_image.c

+ 1 - 1
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);
 	close(fd);
 
 
 	/* Pack the FDT and place the data after it */
 	/* Pack the FDT and place the data after it */