diff mbox series

[PULL,12/18] linux-user: init_guest_space: Clean up if we can't initialize the commpage

Message ID 20180313173355.4468-13-laurent@vivier.eu
State New
Headers show
Series [PULL,01/18] linux-user: Drop unicore32 code | expand

Commit Message

Laurent Vivier March 13, 2018, 5:33 p.m. UTC
From: Luke Shumaker <lukeshu@parabola.nu>

We'll just exit with an error anyway, so it doesn't really matter, but it
is cleaned up in all of the other places were we error out.

Signed-off-by: Luke Shumaker <lukeshu@parabola.nu>
Message-Id: <20171228180814.9749-4-lukeshu@lukeshu.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/elfload.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index eaa52afe79..dcdd756908 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1860,6 +1860,7 @@  unsigned long init_guest_space(unsigned long host_start,
             if (valid == 1) {
                 break;
             } else if (valid == -1) {
+                munmap((void *)real_start, host_size);
                 return (unsigned long)-1;
             }
             /* valid == 0, so try again. */