diff options
| author | Anthony Liguori | 2013-07-10 17:54:09 +0200 |
|---|---|---|
| committer | Anthony Liguori | 2013-07-10 17:54:09 +0200 |
| commit | 9f9a03b9818194da39c6759d9b0cbee5d7ace4e1 (patch) | |
| tree | 8480f4d8fb85216f98e6503f7648fba7ee008e6e /linux-user/mmap.c | |
| parent | Merge remote-tracking branch 'rth/tcg-next' into staging (diff) | |
| parent | linux-user: Do not ignore mmap failure from host (diff) | |
| download | qemu-9f9a03b9818194da39c6759d9b0cbee5d7ace4e1.tar.gz qemu-9f9a03b9818194da39c6759d9b0cbee5d7ace4e1.tar.xz qemu-9f9a03b9818194da39c6759d9b0cbee5d7ace4e1.zip | |
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging
# By Andreas Schwab (2) and others
# Via Riku Voipio
* riku/linux-user-for-upstream:
linux-user: Do not ignore mmap failure from host
linux-user: improve target_to_host_sock_type conversion
user-exec.c: Set is_write correctly in the ARM cpu_signal_handler()
linux-user: Fix sys_utimensat (would not compile on old glibc)
linux-user: fix signal number range check
linux-user: add SIOCADDRT/SIOCDELRT support
linux-user: handle /proc/$$ like /proc/self
Message-id: cover.1373051589.git.riku.voipio@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'linux-user/mmap.c')
| -rw-r--r-- | linux-user/mmap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c index b412e3fe0a..de2219768d 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -483,6 +483,10 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, if (!(flags & MAP_ANONYMOUS)) { p = mmap(g2h(start), len, prot, flags | MAP_FIXED, fd, host_offset); + if (p == MAP_FAILED) { + munmap(g2h(start), host_len); + goto fail; + } host_start += offset - host_offset; } start = h2g(host_start); |
