From patchwork Thu Feb 16 14:22:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 728709 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vPJfp5XvZz9s8T for ; Fri, 17 Feb 2017 01:38:10 +1100 (AEDT) Received: from localhost ([::1]:47057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceNCB-0008U4-Uz for incoming@patchwork.ozlabs.org; Thu, 16 Feb 2017 09:38:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceMxT-0002ef-B1 for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:22:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceMxS-0002NN-0e for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:22:55 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:64491) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceMxR-0002Ml-Ls for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:22:53 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MBkiF-1cUhty3ZuZ-00Ambv; Thu, 16 Feb 2017 15:22:38 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 16 Feb 2017 15:22:23 +0100 Message-Id: <20170216142227.27448-11-laurent@vivier.eu> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170216142227.27448-1-laurent@vivier.eu> References: <20170216142227.27448-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K0:r0Suwn+LBcmY6Ubj8JlPdE0YJfbmKUu8we9G4RJNHDBfDNz+gOS reXR3/Ynla4xGFPlkiZg147yxZGerb+Cy3Erwpjmt2fgyLzoHhMwDwa3M+xGqiL5CwQf8EL WQ87XSVpfmgTxhGnOVpORGtXShF2xUmDlzQhmkHhLUnFBLCid3Z3ZreyWIqRhhPBbAQVvi4 t2zFASYk3qDv30QLdhTfA== X-UI-Out-Filterresults: notjunk:1; V01:K0:4Ob5O+1SfcI=:+Q9XKu9nwvXfPZPtOgKW5t AXoBrpZOhLqQt1Lp+jYs55CThizAGgCXQ+hsKfRupue/3obMmkRtuFP4vycNtN2TuHvV8P7Hw OOAwiy9NCKF/IqeDczWDB7CxvQ/Nb9YZkywISYcb6KgOvqliGMidDtoRoabaz4+4N1PAJu0BD 5FxrL8FUxJhIbgVq6e0l0C4uBnNQRYbgQtMsOo2H75AhLz95DuSH27jVYxy/b/K9a5MdIEc1C NrPlsfsaQ7fSm/0LSpuPnIdb7fKdBvpaICaLCueGwdsoJPRNNBMFsiBbDl7VvC/Fy9C4NjwVC 7yt87f34jQrfHMTviXD5wYH3eBRCIyf+KnSwxekVmlGAcWdmSQRp3iX5QyIv6yGr9ArnHZlq6 QHOE+aGe5FhHKhH0O39dwmeq84+9RGmvqtgpnv4/sx3TbLwyr6mKjixZsdLOP2NrztsnIOVz5 K3XrfZaA2dd5kfLXxl6/ZGZbzJkWYj/n0jiLbJFkaEAfJSGr/Uz97cBIEZcY5fDXhVnHlb0mm i0PqirZ0GTQ+64E9xv8jeMwL4SmHnPXvLTHsen3W6blzaSkYEF0qES+EyZt8Jgw7amZxvG8Hi /SAZkbG88DM67+GqYWhX7tWcZWIQBKuVOpc8apFuoAGGKe5QPmHJfitQLgAVzW5ViiA9fI9Ti PhuF4K1qs0pzFDZ2LbhwITxrx+FtRVvcAv4F1sAVq+zvUBBzPRvyNY4daVtkhX2+qKl7zfCrS rGQDk+O+gsWLsyXD X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.74 Subject: [Qemu-devel] [PULL 10/14] 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: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Pranith Kumar , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Laurent Vivier Message-Id: <20170119151533.29328-1-bobby.prani@gmail.com> Signed-off-by: Laurent Vivier --- 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 d982a27..f569f82 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -12043,10 +12043,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 (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; }