From: Roberto Sassu <roberto.sassu@huawei.com>
To: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>,
"peterhuewe@gmx.de" <peterhuewe@gmx.de>,
"jarkko.sakkinen@linux.intel.com"
<jarkko.sakkinen@linux.intel.com>, "jgg@ziepe.ca" <jgg@ziepe.ca>,
"arnd@arndb.de" <arnd@arndb.de>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"zhang.jia@linux.alibaba.com" <zhang.jia@linux.alibaba.com>
Cc: "linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Silviu Vlasceanu" <Silviu.Vlasceanu@huawei.com>
Subject: RE: [PATCH] tpm: fix wrong return value in tpm_pcr_extend
Date: Tue, 14 Apr 2020 11:55:43 +0000 [thread overview]
Message-ID: <76d46ffbad294a6385779c29c4e5cafd@huawei.com> (raw)
In-Reply-To: <20200414114226.96691-1-tianjia.zhang@linux.alibaba.com>
> -----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.sassu@huawei.com>
Roberto
HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063
Managing Director: Li Peng, Li Jian, Shi Yanli
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> ---
> 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
next prev parent reply other threads:[~2020-04-14 11:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 11:42 [PATCH] tpm: fix wrong return value in tpm_pcr_extend Tianjia Zhang
2020-04-14 11:55 ` Roberto Sassu [this message]
2020-04-14 19:35 ` Jarkko Sakkinen
2020-04-14 20:26 ` Jerry Snitselaar
2020-04-16 16:11 ` Jarkko Sakkinen
2020-04-14 20:26 ` Jerry Snitselaar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76d46ffbad294a6385779c29c4e5cafd@huawei.com \
--to=roberto.sassu@huawei.com \
--cc=Silviu.Vlasceanu@huawei.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=tianjia.zhang@linux.alibaba.com \
--cc=zhang.jia@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).