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

Signed-off-by: Bin Meng <bm...@tinylab.org>
Reviewed-by: Rick Chen <r...@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

Reply via email to