[PATCH 4/8] tools: prelink-riscv: Unmap the ELF image when done

Bin Meng bmeng at tinylab.org
Thu Mar 30 06:20:20 CEST 2023


The codes forget to call munmap() to unmap the ELF image that was
mapped by previous mmap().

Signed-off-by: Bin Meng <bmeng at tinylab.org>
---

 tools/prelink-riscv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/prelink-riscv.c b/tools/prelink-riscv.c
index b0467949eb..43d6412ee9 100644
--- a/tools/prelink-riscv.c
+++ b/tools/prelink-riscv.c
@@ -118,5 +118,7 @@ int main(int argc, const char *const *argv)
 			prelink_le32(data);
 	}
 
+	munmap(data, st.st_size);
+
 	return 0;
 }
-- 
2.34.1



More information about the U-Boot mailing list