]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: prelink-riscv: Unmap the ELF image when done
authorBin Meng <bmeng@tinylab.org>
Thu, 13 Apr 2023 06:20:03 +0000 (14:20 +0800)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Thu, 20 Apr 2023 12:45:08 +0000 (20:45 +0800)
The codes forget to call munmap() to unmap the ELF image that was
mapped by previous mmap().

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>
tools/prelink-riscv.c

index b0467949ebe3f19feae0140ccda8d3283bf6fed8..43d6412ee9b8d3acec24d6a82b0365f4bc03fe8e 100644 (file)
@@ -118,5 +118,7 @@ int main(int argc, const char *const *argv)
                        prelink_le32(data);
        }
 
+       munmap(data, st.st_size);
+
        return 0;
 }