From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dmitry V. Levin" Date: Mon, 03 Dec 2018 03:17:25 +0000 Subject: [PATCH] ia64: fix syscall_get_error() Message-Id: <20181203031725.GA11573@altlinux.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tony Luck , Fenghua Yu Cc: Elvira Khabirova , Eugene Syromyatnikov , linux-ia64@vger.kernel.org, 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E8DCC04EB9 for ; Mon, 3 Dec 2018 03:17:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A7D120881 for ; Mon, 3 Dec 2018 03:17:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A7D120881 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725899AbeLCDR2 convert rfc822-to-8bit (ORCPT ); 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