Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4036532pxj; Tue, 11 May 2021 18:28:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym4ZdZ+mpvjiHm1t+gDtXd+qyvsRvp4hJgomHUMlx/kES6Ld7VkxAtqqyWBBd91Ym18hEC X-Received: by 2002:aa7:cb52:: with SMTP id w18mr39267435edt.294.1620782928986; Tue, 11 May 2021 18:28:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620782928; cv=none; d=google.com; s=arc-20160816; b=Lo7PrA/4bTFKOEBeU4xHLjLyKTgmpU7p5z9M3ur905V4pG6m5LM0Sw0jOgq0ft9Fr1 eXKNxDynLpEQsPT1GKLf0Q+nf7Y5TizbG8jWlr0Q37+9oyb/RuqLXaY8nrDhUPTOg/X0 L9yXp4kd1XmFfVNmJshyTBQtVBdwqW15fklkSF80rsWe36tWfK30Tbj+gfT6Sg+vapFq Kx+imn4XvAR0UsQGyQZV9GqW9P6BFhrasHzrbTaHE7I9Po5TvPSN1oxl5qFRUz+jThZm Cc0RDM4ZRaGfs+HiZNXxb1omYCRPxnMe4Gkhw0wjYW84KfdtTw2mPmHGAxprWPwlZcFe dqtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eWlrAksHe58XMB46fCkce2z+pBMtPT26i4NmOxCN5ww=; b=RbtUoerkJXkN8NmaH6fKLvuwH4qG+2zkM75yrmWhnQT/xhjq6yPuK5fGofPV5qgbAz bULqYQ48Fza/v/m/mff1WuLcHd1WjnSyqSpHyE3Kvx9Gtxgnd6ZRuLdvK4XMGR+hSj1O M9TAxb9qa3MV321X21/YxYYvU65HDUQcVHdx1SsVwq5aWGNX/PP207YYY4FUANJzNQe1 94NPjgonqeLIa6jzHOHnJI3RjQZhMuhXBHbSruWnt9rzqgNZ66HiDCB5aqlhirkFaf0P zJBCInJ7+aRnjZ12xFqPrdKITGzJVDMz9C9CTMXCayhG3eS4pYPt496mbCTNgqFwgm5S Ymhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lNqmtuaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x22si17675100ejf.188.2021.05.11.18.28.24; Tue, 11 May 2021 18:28:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lNqmtuaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbhELBXA (ORCPT + 99 others); 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-kernel@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