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=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 DD5A7C433ED for ; Wed, 12 May 2021 01:21:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B6A1E6192B for ; Wed, 12 May 2021 01:21:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbhELBXA (ORCPT ); Tue, 11 May 2021 21:23:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:36742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbhELBW7 (ORCPT ); Tue, 11 May 2021 21:22:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D91A6191D; Wed, 12 May 2021 01:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620782512; bh=Y80GLNJoGPtq0jASDC6QC2X7eZgo2bdGjTqkSYP0pNA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lNqmtuazkC32aJEPueGyekKLzfkwyq9zC8oDaUpYvD4LAwNU/sdkoHuEtsElikULC Vpb08vVEstRzUzVvcniPL5UNXeP6d98gf7z5KQmOzOsQetIIvjpTryVUhKQ6LkUqnl D76x6uiPYDz/B2oHeI4W4UyiS80MSp1dVbGn3KYaeLCDtOMG5o3IxxUCjyE2Pho18i fnjIk6nbelrkhnl2ZoFfMbEV4ARkr7CCBUvoiT7rdV8rN4D3OKQ0K2BGwr4K4gdlxD 1ENQp96Mr/3yH9vbZn0Sk6iQZ/fIg3DE87HAFgPmFkuiRSwu1Sxiih0tinBGJ549Bu F8t6/e4yoSG1Q== Date: Wed, 12 May 2021 04:21:50 +0300 From: Jarkko Sakkinen To: "Leizhen (ThunderTown)" Cc: Peter Huewe , Jason Gunthorpe , James Bottomley , linux-integrity , linux-kernel Subject: Re: [PATCH 1/1] tpm: fix error return code in tpm2_get_cc_attrs_tbl() Message-ID: References: <20210508025444.1977-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Wed, May 12, 2021 at 09:12:26AM +0800, Leizhen (ThunderTown) wrote: > > > On 2021/5/10 4:41, Jarkko Sakkinen wrote: > > On Sat, May 08, 2021 at 10:54:44AM +0800, Zhen Lei wrote: > >> Fix to return a negative error code from the error handling > >> case instead of 0, as done elsewhere in this function. > >> > >> Fixes: 58472f5cd4f6("tpm: validate TPM 2.0 commands") > >> Reported-by: Hulk Robot > >> Signed-off-by: Zhen Lei > > > > In the commit message: > > > > 1. Instead of writing "a negative error code", write -EFAULT. > OK, I will change it. > > > 2. Some explanation of the choice. > Do you mean why I choice error code -EFAULT? There's a similar one above this branch. > > if (nr_commands > 0xFFFFF) { > rc = -EFAULT; > goto out; > } I mean that the commit message must rationalize whatever the commit does, and choices made. /Jarkko