From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
Nayna Jain <nayna@linux.vnet.ibm.com>,
Alexander Usyskin <alexander.usyskin@intel.com>,
Tadeusz Struk <tadeusz.struk@intel.com>,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle()
Date: Thu, 18 Oct 2018 02:01:22 +0300 (EEST) [thread overview]
Message-ID: <alpine.DEB.2.21.1810180057470.5022@jsakkine-mobl1> (raw)
In-Reply-To: <20181015111434.7777-1-tomas.winkler@intel.com>
On Mon, 15 Oct 2018, Tomas Winkler wrote:
> Ignore the return value of go_to_idle() in tpm_try_transmit().
> Once it may shadow the return value of actual tpm operation,
> second the consequent command will fail as well and the error
> will be caought anyway.
> Last fix wrong goto, that jumped back instead of forward.
>
> Fixes: 627448e85c76 ("tpm: separate cmd_ready/go_idle from runtime_pm")
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
> drivers/char/tpm/tpm-interface.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index 129f640424b7..f69c711bf74a 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -547,9 +547,7 @@ static ssize_t tpm_try_transmit(struct tpm_chip *chip,
> dev_err(&chip->dev, "tpm2_commit_space: error %d\n", rc);
>
> out:
> - rc = tpm_go_idle(chip, flags);
> - if (rc)
> - goto out;
> + (void)tpm_go_idle(chip, flags);
>
> if (need_locality)
> tpm_relinquish_locality(chip, flags);
> --
> 2.14.4
>
>
LGTM. Should be probably Cc'd to stable (can add).
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
/Jarkko
next prev parent reply other threads:[~2018-10-17 23:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-15 11:14 [PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle() Tomas Winkler
2018-10-16 5:41 ` Jason Gunthorpe
2018-10-16 6:20 ` Winkler, Tomas
2018-10-17 23:01 ` Jarkko Sakkinen [this message]
2018-10-17 23:08 ` Winkler, Tomas
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=alpine.DEB.2.21.1810180057470.5022@jsakkine-mobl1 \
--to=jarkko.sakkinen@linux.intel.com \
--cc=alexander.usyskin@intel.com \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=nayna@linux.vnet.ibm.com \
--cc=tadeusz.struk@intel.com \
--cc=tomas.winkler@intel.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).