Signed-off-by: Richard Henderson <r...@twiddle.net>
---
 linux-user/mmap.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 463679d..085030b 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -494,12 +494,8 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int 
prot,
         end = start + len;
         real_end = HOST_PAGE_ALIGN(end);
 
-       /*
-        * Test if requested memory area fits target address space
-        * It can fail only on 64-bit host with 32-bit target.
-        * On any other target/host host mmap() handles this error correctly.
-        */
-        if ((unsigned long)start + len - 1 > (abi_ulong) -1) {
+       /* Test if requested memory area fits target address space.  */
+        if (!guest_start_len_valid(start, len)) {
             errno = EINVAL;
             goto fail;
         }
-- 
1.6.6.1



Reply via email to