Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp580034ybz; Wed, 15 Apr 2020 14:27:50 -0700 (PDT) X-Google-Smtp-Source: APiQypKYtCGmU9lg3ikecRmx9I3z9BerPRfVt/mwsvyQSgnmajb+jmRcumSMF4f4OpJKMu85EBC8 X-Received: by 2002:a17:906:38ca:: with SMTP id r10mr6584154ejd.278.1586986070706; Wed, 15 Apr 2020 14:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586986070; cv=none; d=google.com; s=arc-20160816; b=d1SqzKkOshUT2iNg87hxdQOuU4oW0wf48WT27eawgvrVrtIx9/x8BNiGLUsxu+yiuU 8+Xk/b1GkdiJqfv24g1Jjt/XeF1XcxjF0+nzD31uzxzo624BRM5j8++gaSZO4JBIOyCj ZkHlKQ1u1vyJPzkGXyjGcXVL4VUtuEWyu4XwhJk/erF6kbpZHzsJU0ZwFXU04X8pY+86 D9BZo25pNxS6i+qQN4EbvsX/rGXMcSvvZ/JuoeMSzLBdhngo283jmwN2alw85P6VUe+i nMFZf9rS2p/haHCGR0F3Cp3zyZbETTfZiosQkWrSlh9MhwhXks4Q4bX+B/cGWYDPz7aQ XQUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=wfu+k9f3RyeoOdloezux+QEITveRVSAKhLqhoqMnQAI=; b=WaPvjHhPwy6DxaQQLRJohqwIB/gOIPIRazQp0uB3ibx2VtzFOysGzAooxb246Evc+X xm1NL6i3yu4NYOI3Vj4didC2y502VAjDPybJCEEmYeMwQsXYaskAau56FNL8VQND8+N8 WjPjP6Y42gzplsd/eeUJBrrJKGVFO0l266sYtdoy/An/YDwPGMINvB2YLMZjStBdC7Z7 P0Qrnb0Q7NsmRq8DACikbNBBOHRfzhxTZbGSvVvQEBpj5nK03HYo3MpoWp+lhOcENZ4O 6IpDADeqRCzmdrI7gPrIKARwSRPOGOGztRSTGChEKFKfzXGP9DVyg/8aHPA+ZUFc9nGQ AsaA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dx23si8670249ejb.181.2020.04.15.14.27.27; Wed, 15 Apr 2020 14:27:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439691AbgDNLzu convert rfc822-to-8bit (ORCPT + 99 others); Tue, 14 Apr 2020 07:55:50 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2050 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2439662AbgDNLzs (ORCPT ); Tue, 14 Apr 2020 07:55:48 -0400 Received: from lhreml708-chm.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 972136BC52AD3612480C; Tue, 14 Apr 2020 12:55:44 +0100 (IST) Received: from fraeml706-chm.china.huawei.com (10.206.15.55) by lhreml708-chm.china.huawei.com (10.201.108.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1913.5; Tue, 14 Apr 2020 12:55:44 +0100 Received: from fraeml714-chm.china.huawei.com (10.206.15.33) by fraeml706-chm.china.huawei.com (10.206.15.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1913.5; Tue, 14 Apr 2020 13:55:43 +0200 Received: from fraeml714-chm.china.huawei.com ([10.206.15.33]) by fraeml714-chm.china.huawei.com ([10.206.15.33]) with mapi id 15.01.1913.007; Tue, 14 Apr 2020 13:55:43 +0200 From: Roberto Sassu To: Tianjia Zhang , "peterhuewe@gmx.de" , "jarkko.sakkinen@linux.intel.com" , "jgg@ziepe.ca" , "arnd@arndb.de" , "gregkh@linuxfoundation.org" , "zhang.jia@linux.alibaba.com" CC: "linux-integrity@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Silviu Vlasceanu" Subject: RE: [PATCH] tpm: fix wrong return value in tpm_pcr_extend Thread-Topic: [PATCH] tpm: fix wrong return value in tpm_pcr_extend Thread-Index: AQHWElHViMvwppAnhkyyxXpkQ/lFwqh4geGA Date: Tue, 14 Apr 2020 11:55:43 +0000 Message-ID: <76d46ffbad294a6385779c29c4e5cafd@huawei.com> References: <20200414114226.96691-1-tianjia.zhang@linux.alibaba.com> In-Reply-To: <20200414114226.96691-1-tianjia.zhang@linux.alibaba.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.47.19.203] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: linux-integrity-owner@vger.kernel.org [mailto:linux-integrity- > owner@vger.kernel.org] On Behalf Of Tianjia Zhang > Sent: Tuesday, April 14, 2020 1:42 PM > To: peterhuewe@gmx.de; jarkko.sakkinen@linux.intel.com; jgg@ziepe.ca; > arnd@arndb.de; gregkh@linuxfoundation.org; zhang.jia@linux.alibaba.com > Cc: linux-integrity@vger.kernel.org; linux-kernel@vger.kernel.org; > tianjia.zhang@linux.alibaba.com > Subject: [PATCH] tpm: fix wrong return value in tpm_pcr_extend > > For the algorithm that does not match the bank, a positive > value EINVAL is returned here. I think this is a typo error. > It is necessary to return an error value. Yes, thanks. Reviewed-by: Roberto Sassu Roberto HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Li Peng, Li Jian, Shi Yanli > Signed-off-by: Tianjia Zhang > --- > drivers/char/tpm/tpm-interface.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm- > interface.c > index a438b1206fcb..1621ce818705 100644 > --- a/drivers/char/tpm/tpm-interface.c > +++ b/drivers/char/tpm/tpm-interface.c > @@ -323,7 +323,7 @@ int tpm_pcr_extend(struct tpm_chip *chip, u32 > pcr_idx, > > for (i = 0; i < chip->nr_allocated_banks; i++) { > if (digests[i].alg_id != chip->allocated_banks[i].alg_id) { > - rc = EINVAL; > + rc = -EINVAL; > goto out; > } > } > -- > 2.17.1