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: 76757 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1991qgf; Thu, 22 Sep 2016 05:26:51 -0700 (PDT) X-Received: by 10.55.129.71 with SMTP id c68mr1732211qkd.189.1474547211263; Thu, 22 Sep 2016 05:26:51 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f62si963509qtd.55.2016.09.22.05.26.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:26:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn35W-0001c1-Mk for patch@linaro.org; Thu, 22 Sep 2016 08:26:50 -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+patch=linaro.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(-) -- 2.1.4 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;