From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52896 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Psutl-0004hr-3N for qemu-devel@nongnu.org; Fri, 25 Feb 2011 05:27:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Psutj-00046x-Os for qemu-devel@nongnu.org; Fri, 25 Feb 2011 05:27:44 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:48954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Psutj-00046B-HX for qemu-devel@nongnu.org; Fri, 25 Feb 2011 05:27:43 -0500 From: Peter Maydell Date: Fri, 25 Feb 2011 10:27:40 +0000 Message-Id: <1298629660-23901-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from poll() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio , patches@linaro.org 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 --- 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