From patchwork Thu Sep 22 12:13:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 673342 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 3sfwh24Trmz9t0p for ; Thu, 22 Sep 2016 22:25:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=K97J1oNu; dkim-atps=neutral Received: from localhost ([::1]:43070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn34a-0001c1-3z for incoming@patchwork.ozlabs.org; Thu, 22 Sep 2016 08:25:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2uC-0008Iy-Io for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn2uA-0006UO-NW for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:07 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:33177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2uA-0006Tz-GU for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:06 -0400 Received: by mail-lf0-f44.google.com with SMTP id b71so38933349lfg.0 for ; Thu, 22 Sep 2016 05:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HRNTyEGxuSXeEGkKD0d/u9dmom2sBAPq3yeHcpkohhE=; b=K97J1oNutDVwKgM2mKCibmbUVj9E2v/9POUzDzIdSnm0mptd3D8x77NMJCYfq3Q6d9 OpTzn+/gxgj+rZxZAv/No2VENk0c/ecENpeqE4HOChSxgh8DbO4OCCJm7grxXN1HuQyp +VzUkE3/jx415zNAUGlGVo++jSqf/JAc2MVgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HRNTyEGxuSXeEGkKD0d/u9dmom2sBAPq3yeHcpkohhE=; b=JPd44npZcpRW1tIzmqQHKxiXhXTr71zbDE5xDl4hv25cCkFkejPQQ7EC6u3zdv5y93 /8xC/0fDHP1g6uGDQrBYjjQ3HGL/h4qkUCvJZcE6ipC3Rhbfj7VqVWO3ZhsQneN3VTzV EDLWdvqLNu2Ny16aDqtL253l+sPod6v3Ocu6Yx7wRQkKnZjHVZLPxEzZK6NgV07hm1ng +9ElsMtWadUmf25t+ybqrpQcZAYecUu2V43BduiE542jq2Zuzq5RfVCs0TqjR5ZA0F3g SN/UwXC3MBHtzRqFveJaqUq8jOABXxHLUkFM5jyuGdPDqlMcv/J5IryCSJNh6m1lCRWK Maog== X-Gm-Message-State: AE9vXwMcckr6SJGNV3jgolQ4XMKeeSByJfkXvGfslTjyx+rT3tFTMth2U5tSVnX9t1c31+ZC X-Received: by 10.25.214.42 with SMTP id n42mr763082lfg.109.1474546445508; Thu, 22 Sep 2016 05:14:05 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id u14sm294378lja.11.2016.09.22.05.14.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:14:04 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 22 Sep 2016 15:13:31 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.44 Subject: [Qemu-devel] [PULL 11/26] linux-user: Fix incorrect use of host errno in do_ioctl_dm() 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 Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell do_ioctl_dm() should return target errno values, not host ones; correct an accidental use of a host errno in an error path. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index efcc17a..e286907 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5001,7 +5001,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, guest_data = arg + host_dm->data_start; if ((guest_data - arg) < 0) { - ret = -EINVAL; + ret = -TARGET_EINVAL; goto out; } guest_data_size = host_dm->data_size - host_dm->data_start;