qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 5/7] linux-user: Use guest_start_len_valid in mmap.


From: Richard Henderson
Subject: [Qemu-devel] [PATCH 5/7] linux-user: Use guest_start_len_valid in mmap.
Date: Tue, 30 Mar 2010 11:53:31 -0700

Signed-off-by: Richard Henderson <address@hidden>
---
 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

[Prev in Thread] Current Thread [Next in Thread]