From patchwork Wed Jan 18 19:24:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9524619 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 434C460113 for ; Wed, 18 Jan 2017 19:24:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 351EC2861E for ; Wed, 18 Jan 2017 19:24:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A02C2862C; Wed, 18 Jan 2017 19:24:52 +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 18FAA2861E for ; Wed, 18 Jan 2017 19:24:50 +0000 (UTC) Received: from localhost ([::1]:43829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTvqj-0002Oj-M8 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Jan 2017 14:24:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTvqU-0002OG-1P for qemu-devel@nongnu.org; Wed, 18 Jan 2017 14:24:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTvqR-0002uk-0L for qemu-devel@nongnu.org; Wed, 18 Jan 2017 14:24:34 -0500 Received: from mail-yw0-x242.google.com ([2607:f8b0:4002:c05::242]:33324) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTvqQ-0002uN-Rl for qemu-devel@nongnu.org; Wed, 18 Jan 2017 14:24:30 -0500 Received: by mail-yw0-x242.google.com with SMTP id u68so1983152ywg.0 for ; Wed, 18 Jan 2017 11:24:30 -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=ocdfn5YFNjyjZCZT1F8QOCcKBp1KYNDBgsPCbwgAbdA=; b=bsqF4JMKtYOeBjXPt6V0oblMfhmftjFOf5f2myZ5oZpqbZrH2I5LDPJN1bY0OU4XFe JO7aQ24fitEBU8hv20piJvDVaqbZcxWidDUDPtFBl6bWrae6BVqawPIcN5TI3q8ecXKX KgD8Vv/ZkAX/beMqCiseu2qYUVRoIVQv0z44TxTgPquBWBZIEsppeKwDFuhUKNkNjkKW Ja2GorPCd9UJ/qWNrZCul5pkm5NFxNhdcu38tscaW9kQ7eTMz/q7fGSQHF4eiAXot8H3 rCkrG8OQXfx0RqOuxXOJlv6XO7hAOtiBNKIMDi19DcYoaKOQi+BZSqwlIaCdovXFBvoH YWYg== 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=ocdfn5YFNjyjZCZT1F8QOCcKBp1KYNDBgsPCbwgAbdA=; b=gSR11cIOt9+yJp/F/OSj4yymvnYihyQLf6KsGrregPJfS/2JrcNZgq6jNrvqA04wKA 0UHwK7mPOKH6BeLrEBOtmk849Tt2cd1KLu29aRo2fSjYdFns7dhGJ2C+2xhwY+lC06IS ezAl9ZcB9s68SY4eMu+JYjlkz3koB+yKBa6kMeg1auW3lMbadJJKEul6o9j3XsWhlnfU FuDg/5YaWQViambZD2uNVvO5w36XViAKNbigcUWjUzMKXg8JlIL1PSiQoBbOtpsZ//39 l4bpx1C7ciG4iryy+WHAwcQrkmtjAaKcgud4f+jNrnAtZiG81EnOCq98ZbayWx9vf3UX oAGw== X-Gm-Message-State: AIkVDXIqR91aImFtj6LeT6YOO6Urf7VChfUcfPBRCc49KNGdzSV7Dzs2QQ69Y8hofRXtMw== X-Received: by 10.13.234.205 with SMTP id t196mr3613295ywe.108.1484767469931; Wed, 18 Jan 2017 11:24:29 -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 i9sm569859ywe.12.2017.01.18.11.24.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 11:24:29 -0800 (PST) From: Pranith Kumar To: alex.bennee@linaro.org Date: Wed, 18 Jan 2017 14:24:27 -0500 Message-Id: <20170118192428.2661-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::242 Subject: [Qemu-devel] [PATCH v2 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. CC: Laurent Vivier Signed-off-by: Marc-André Lureau [pranith: review comments] Signed-off-by: Pranith Kumar Reviewed-by: Alex Bennée --- linux-user/syscall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7b77503f94..724607be43 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -12027,7 +12027,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, target_to_host_itimerspec(&hspec_new, arg3); 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; }