From patchwork Thu Jan 19 14:23:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9526055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83B5860113 for ; Thu, 19 Jan 2017 14:44:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73ABC28520 for ; Thu, 19 Jan 2017 14:44:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67E7028531; Thu, 19 Jan 2017 14:44:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 14E0228520 for ; Thu, 19 Jan 2017 14:44:53 +0000 (UTC) Received: from localhost ([::1]:48710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUDxM-0004fe-RX for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Jan 2017 09:44:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUDcT-0003UO-Dj for qemu-devel@nongnu.org; Thu, 19 Jan 2017 09:23:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUDcQ-0004Z5-Aj for qemu-devel@nongnu.org; Thu, 19 Jan 2017 09:23:17 -0500 Received: from mail-yw0-x244.google.com ([2607:f8b0:4002:c05::244]:35175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cUDcQ-0004Yy-6Y for qemu-devel@nongnu.org; Thu, 19 Jan 2017 09:23:14 -0500 Received: by mail-yw0-x244.google.com with SMTP id 17so4408161ywk.2 for ; Thu, 19 Jan 2017 06:23:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=j0VqY6VF4bBmb6MWeHfsLCo0S8fuqrJmJQEbNekgve4=; b=mvkf1FRu2fKzwnXOQ6BgFNc6hojAzu6S9tKMDqLFhJCrAWGWzVbrQwcceyWwxOH9vJ vt9d4Bm+MEtOFNBPk8Fo/xocqBxV3SOXRmryucAfbyUVJCLngtj/1OgzC5uT6XYtbS3l 3DIjHs0zh0cNX55XTWV9dpXDOirnZrHKuhWPIHFarvWuNdcu7gIXKQ1Gz6IshKunYlKz /MVK+zy1eObbGd4k/bQzY9gLczSNUzmrxs1lnayuRccwwLMvcQkmPjEjHrliI4CxHXwW ryz8Zq4JknnLN6iz4zm3tQFHEo40ywpWBB2LbW0P5N8vSgWezi76df40GmU4f1+9HdG9 QQGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=j0VqY6VF4bBmb6MWeHfsLCo0S8fuqrJmJQEbNekgve4=; b=P0pg5g1EV7qpYqhG4hNNpx/eMm8wN4PtAavhK/9XpORWzacyMikiSDFmAMymZnADkf tZX8nOPq+wItZHe8eHY+z70zRS5Lix04rB15DCOseo7DtSWeFNeu9ZlDjaUMc7nZ6t8V IU08dtxBNXLzXOwEBw4HS18TvkFyzYUhuST0oyZE6l3Wkb5dYsIG88jRF1MYYivOJTQw 7WoVfOhr1D5ES8bWT9cXaJlcbHTt9JV+mXboW5Wprno2KseHcVsJ44BDsU2D+mbPrRBr tM7k5tbJ+sWxOQexMINDJGxV65H8YDnibu6DS+d+e88BFGkT+EgZnQFcVoxgeBIO3RlV hi3w== X-Gm-Message-State: AIkVDXKTGcE+//VQh0VmNYfCPw23rkN5bbLce74XBvxnMQqoKfsgTkPllZNHhbqFHNWT1g== X-Received: by 10.129.131.133 with SMTP id t127mr7468916ywf.261.1484835793487; Thu, 19 Jan 2017 06:23:13 -0800 (PST) Received: from localhost.localdomain (c-73-207-178-95.hsd1.ga.comcast.net. [73.207.178.95]) by smtp.gmail.com with ESMTPSA id k14sm1790320ywi.11.2017.01.19.06.23.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2017 06:23:12 -0800 (PST) From: Pranith Kumar To: alex.bennee@linaro.org Date: Thu, 19 Jan 2017 09:23:10 -0500 Message-Id: <20170119142311.8310-1-bobby.prani@gmail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::244 Subject: [Qemu-devel] [PATCH v3 1/2] linux-user: fix settime old value location X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, laurent@vivier.eu, qemu-devel@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André Lureau old_value is the 4th argument of timer_settime(), not the 2nd. Signed-off-by: Marc-André Lureau Signed-off-by: Pranith Kumar --- linux-user/syscall.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7b77503f94..a393764a17 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -12024,10 +12024,14 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, timer_t htimer = g_posix_timers[timerid]; struct itimerspec hspec_new = {{0},}, hspec_old = {{0},}; - target_to_host_itimerspec(&hspec_new, arg3); + if (arg3 && target_to_host_itimerspec(&hspec_new, arg3)) { + goto efault; + } ret = get_errno( timer_settime(htimer, arg2, &hspec_new, &hspec_old)); - host_to_target_itimerspec(arg2, &hspec_old); + if (arg4 && host_to_target_itimerspec(arg4, &hspec_old)) { + goto efault; + } } break; }