We merged commit 51ddba8a6354 ("vmm: Added helper functions to
user/vmm/memory.c") right before this was fixed.

Signed-off-by: Barret Rhoden <[email protected]>
---

Will merge directly.

 user/vmm/memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/user/vmm/memory.c b/user/vmm/memory.c
index 2e5e474414d1..8023da743d41 100644
--- a/user/vmm/memory.c
+++ b/user/vmm/memory.c
@@ -182,6 +182,8 @@ bool mmap_file(const char *path, uintptr_t memstart, 
uintptr_t memsize,
 
        if ((uint64_t) addr != (uint64_t) memstart) {
                fprintf(stderr, "Could not mmap %s correctly.\n", path);
+               if (munmap(addr, memsize) == -1)
+                       perror("Failed to unmap memory; leaking a mapping");
                return false;
        }
        return true;
-- 
2.14.1.581.gf28d330327-goog

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to