Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5892517rwp; Mon, 17 Jul 2023 11:04:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXQsJgMq9d1149v2TtXQoiJW4A7xmYVXVMnjGXiG073uEq/su0nSL7kzbquD9QRPdsB/o8 X-Received: by 2002:a17:906:54:b0:994:1805:1fad with SMTP id 20-20020a170906005400b0099418051fadmr11854158ejg.10.1689617099589; Mon, 17 Jul 2023 11:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689617099; cv=none; d=google.com; s=arc-20160816; b=lZ8M1n3M8Vnk8IMV3r9NuESpY9h5tjUXhkE7MScS9q4pXudgtHufO5NhsD5MGs+Elh Q/DDcuAOmmBt/WAcEtVNmVyoTqST2xXaz0VSa1ZKHsAOubp9CzUUocpPKbtuMX5IhPh1 78/PkCcLZHYEOmd2V9CY2AkBNqpi2cNExmS4vDq5UPLaGIBnFlcr+T3txg+c0VlTOAwH gBgbcNfSn8ROdyZA2GKpju8EW3do0Ghn1tfDQdr+5QUIRWQAKjNac4jz/ou7xU8SgejJ FWJF8zsIitB1svirQXxnvuv41zkzSzN095Fo+JoS4n0HqeHIr2+AxHT2bwyXWjzeD2iB c4Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Fpk05MGU6nNGzQRzekEDu8vSE/s3ApjtFu1sQjrmUCg=; fh=9PzCOzaLTeDx/5089nUNFUnHZlK1qcYgr/v45Yt1FDk=; b=042j3d1T8+8kwM+AxFUUla6EtjBBtCxMZqHkotsMOZ0/A+vlPp0YuleRZf+FVzufYP z2ayjU82ZEF6ozbI3YydILdBev7wRVp1NzFwMAuMPV0y3UQT3YzXGWwh4a2rZN0YHznh 2S1JLrqkzCpKb7gamxBPI8xlVVNjhNS6j4tjxIbAS729rBae97hcsYzofAfTv8j/tKmR E+yTBIgngQBrzmXmxU8onRKgwGLv1Jx3XbfJ5gu/3J3K7Yiz5X+NRp/DkUYqA+5CIazr 4vreYjbm25t2wGQEIjGNeQddzR2ZKTT4zE/geUyqn4fLqfqB3H4i5jfUaTdRF0w8MXL9 8LZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Hq9VMBES; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a1709060e1200b00992d753205csi4814354eji.658.2023.07.17.11.04.34; Mon, 17 Jul 2023 11:04:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Hq9VMBES; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbjGQRzQ (ORCPT + 99 others); Mon, 17 Jul 2023 13:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbjGQRzP (ORCPT ); Mon, 17 Jul 2023 13:55:15 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856D91A8 for ; Mon, 17 Jul 2023 10:55:13 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id LSRBqStkanCoyLSRBquzGy; Mon, 17 Jul 2023 19:55:10 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1689616511; bh=Fpk05MGU6nNGzQRzekEDu8vSE/s3ApjtFu1sQjrmUCg=; h=From:To:Cc:Subject:Date; b=Hq9VMBESswxqmkPDQDZwqnoyp75phIcB8PgZ5YKAqBrPnSxhj1oMThwXh3liI5+aL qaN069ATLkY7lVcTsRNKxp0nkHZXTQ7rRaA+3E7fqHcHjwVZdUzBa62tURVKrhmy/d Z6w/NiFpMqC/N9zcwky+sG04NQdboEa12mmPN5PmYSpTyq16xMbalOVU9dEsPGbKku XU+bIOYOzgs8ICIMcmMlzgbfC8FXPMUWUNtsOOvhWYo7pvSE63kKCqkn9l7HUaBEMj bnfF+yQhvcwDVnFMl6LGK8HRbud6Bj6M98Ulp2kDz/x8NehWq0/9c0Wyo/NAlav1F9 wx3vHkrLbSGcQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 17 Jul 2023 19:55:10 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Oleg Nesterov , Catalin Marinas , Will Deacon , Mark Brown Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64/ptrace: Fix an error handling path in sve_set_common() Date: Mon, 17 Jul 2023 19:55:05 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All error handling paths go to 'out', except this one. Be consistent and also branch to 'out' here. Fixes: e12310a0d30f ("arm64/sme: Implement ptrace support for streaming mode SVE registers") Signed-off-by: Christophe JAILLET --- /!\ Speculative /!\ This patch is based on analysis of the surrounding code and should be reviewed with care ! If the patch is wrong, maybe a comment in the code could explain why. /!\ Speculative /!\ --- arch/arm64/kernel/ptrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index d7f4f0d1ae12..9bc23f1b499e 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -884,7 +884,8 @@ static int sve_set_common(struct task_struct *target, break; default: WARN_ON_ONCE(1); - return -EINVAL; + ret = -EINVAL; + goto out; } /* -- 2.34.1