Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6474205imu; Sun, 2 Dec 2018 19:18:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/WkO4Gj3Nc1nA0/LQdf+ZISDHVRJWQDHTkxOM0uRuPgh8SdmU44YWQYAWeyVm4o6O3z3PPT X-Received: by 2002:a62:2b8b:: with SMTP id r133mr2906546pfr.246.1543807128633; Sun, 02 Dec 2018 19:18:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543807128; cv=none; d=google.com; s=arc-20160816; b=QzVz5hZpFNY0RJ2ZXkQNE5Ayj5IAuS18G9RlTEEV5NlEpT+g1MfKVs/eCkBqqzmDAm CCJZIZTXEWK43u5UaRCvJXrwDjI0Z1YoSNj2QgST2ZoFbPaI7tPN1Uvf01t6bkjrUF+H oB9ytQVi97GVcrvXPH/JSAP1n0RXE+spkUzw+buFTP5tSoQ4YLnvUu9NzHOYe+jE2vPr 05vf6puREzwSCamJHabqn4O/bnOgtvDxTnLKMEhvnNmzMP2V51QH9WSGguVJhZzi67xG zy3dom37Kp5GB+1AuUNCW3R1sueeUSvoxfpSpMKJ99vl24Z1uCMZHpF4f/VyqkteoDq3 dm2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date; bh=KM1aZEioqO3cVXQ8/6Pnyk//g0zJgQXWW/LODt8T6VY=; b=aEgBmdiCoP9MdQE2/6qPKrRCqtms7cIxCM0LL7O3Qu9pqPJUP0oZ8BexSLXIenjeoM C8pWhpuXDWtahMWyD4Z6cjy6H3nPGqtqAnEQrZ/zq+89hro1E1HqdvJqusM9h4LatgV1 u7kcsWWqCM+2yS6pGeEX250SGd/X0AxDnTX5DcoV3qcvpu+2Crdiwu8/9nJnce/Uprio ARn+790ytMbPC1ae90ibfuhI39aBzj0me9PGT9O38OWriLflNKlBLhayhO86puIdzHBh Z0BbjEh0pzXmfRkchgwhWoVqRwSayDESVOFxYMaks5C8PE9LLBloebSrGWn4EXXLWaTQ sf4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s73si12254583pfs.54.2018.12.02.19.18.21; Sun, 02 Dec 2018 19:18:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725893AbeLCDR2 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 2 Dec 2018 22:17:28 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:51138 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725803AbeLCDR2 (ORCPT ); Sun, 2 Dec 2018 22:17:28 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id AEE6172CA65; Mon, 3 Dec 2018 06:17:25 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 9CFBF7CCEA3; Mon, 3 Dec 2018 06:17:25 +0300 (MSK) Date: Mon, 3 Dec 2018 06:17:25 +0300 From: "Dmitry V. Levin" To: Tony Luck , Fenghua Yu Cc: Elvira Khabirova , Eugene Syromyatnikov , linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ia64: fix syscall_get_error() Message-ID: <20181203031725.GA11573@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org According to documentation in include/asm-generic/syscall.h, syscall_get_error() should return -ERRORCODE if the system call failed. This change fixes syscall_get_error() implementation on ia64 to match its own syscall_set_return_value(), the documentation, and other architectures where syscall_get_error() returns a non-positive value. Fixes: cfb361f13c81 ("[IA64] utrace syscall.h support for ia64") Cc: stable@vger.kernel.org # v2.6.27+ Signed-off-by: Dmitry V. Levin --- arch/ia64/include/asm/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/include/asm/syscall.h b/arch/ia64/include/asm/syscall.h index 1d0b875fec44..4ccf888c083d 100644 --- a/arch/ia64/include/asm/syscall.h +++ b/arch/ia64/include/asm/syscall.h @@ -35,7 +35,7 @@ static inline void syscall_rollback(struct task_struct *task, static inline long syscall_get_error(struct task_struct *task, struct pt_regs *regs) { - return regs->r10 == -1 ? regs->r8:0; + return regs->r10 == -1 ? -regs->r8 : 0; } static inline long syscall_get_return_value(struct task_struct *task, -- ldv