From mboxrd@z Thu Jan 1 00:00:00 1970 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) From: Pranith Kumar Date: Wed, 18 Jan 2017 14:24:27 -0500 Message-Id: <20170118192428.2661-1-bobby.prani@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v2 1/2] linux-user: fix settime old value location List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alex.bennee@linaro.org Cc: qemu-devel@nongnu.org, rth@twiddle.net, peter.maydell@linaro.org, laurent@vivier.eu, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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; } -- 2.11.0