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

Bin Meng bmeng at tinylab.org
Thu Apr 13 08:20:03 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>
Reviewed-by: Rick Chen <rick at andestech.com>
---

(no changes since v1)

 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