From patchwork Fri Feb 25 10:27:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 84532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 08F39B70F3 for ; Fri, 25 Feb 2011 21:28:57 +1100 (EST) Received: from localhost ([127.0.0.1]:36998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Psuug-0004jH-O6 for incoming@patchwork.ozlabs.org; Fri, 25 Feb 2011 05:28:42 -0500 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 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Psutg-0006Dw-HX; Fri, 25 Feb 2011 10:27:40 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 25 Feb 2011 10:27:40 +0000 Message-Id: <1298629660-23901-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Riku Voipio , patches@linaro.org Subject: [Qemu-devel] [PATCH] linux-user: Fix unlock_user() call in return from poll() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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