qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from p


From: Peter Maydell
Subject: [Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from poll()
Date: Fri, 25 Feb 2011 10:27:40 +0000

Correct the broken attempt to calculate the third argument
to unlock_user() in the code path which unlocked the pollfd
array on return from poll() and ppoll() emulation. (This
only caused a problem if unlock_user() wasn't a no-op, eg
if DEBUG_REMAP is defined.)

Signed-off-by: Peter Maydell <address@hidden>
---
 linux-user/syscall.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cf8a4c3..822b863 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6314,10 +6314,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 
arg1,
                 for(i = 0; i < nfds; i++) {
                     target_pfd[i].revents = tswap16(pfd[i].revents);
                 }
-                ret += nfds * (sizeof(struct target_pollfd)
-                               - sizeof(struct pollfd));
             }
-            unlock_user(target_pfd, arg1, ret);
+            unlock_user(target_pfd, arg1, sizeof(struct target_pollfd) * nfds);
         }
         break;
 #endif
-- 
1.7.1




reply via email to

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