From: Jarkko Sakkinen <jarkko@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: peterhuewe@gmx.de, jgg@ziepe.ca, hao.wu@rubrik.com,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] tpm_tis: Fix an error handling path in 'tpm_tis_core_init()'
Date: Sun, 7 Nov 2021 19:04:35 +0200 [thread overview]
Message-ID: <YYgHI3vKzD2/b7R/@iki.fi> (raw)
In-Reply-To: <7391611c2f2c5ca9fcea5b960fe6f7cac12121f4.1636216848.git.christophe.jaillet@wanadoo.fr>
On Sat, Nov 06, 2021 at 05:42:04PM +0100, Christophe JAILLET wrote:
> Commit 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent
> queries") has moved some code around without updating the error handling
> path.
>
> This is now pointless to 'goto out_err' when neither 'clk_enable()' nor
> 'ioremap()' have been called yet.
>
> Make a direct return instead to avoid undoing things that have not been
> done.
>
> Fixes: 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/char/tpm/tpm_tis_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
> index b2659a4c4016..e672d2dc8937 100644
> --- a/drivers/char/tpm/tpm_tis_core.c
> +++ b/drivers/char/tpm/tpm_tis_core.c
> @@ -952,7 +952,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
>
> rc = tpm_tis_read32(priv, TPM_DID_VID(0), &vendor);
> if (rc < 0)
> - goto out_err;
> + return rc;
>
> priv->manufacturer_id = vendor;
>
> --
> 2.30.2
>
Thank you.
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
/Jarkko
prev parent reply other threads:[~2021-11-07 17:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-06 16:42 Christophe JAILLET
2021-11-07 17:04 ` Jarkko Sakkinen [this message]
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=YYgHI3vKzD2/b7R/@iki.fi \
--to=jarkko@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=hao.wu@rubrik.com \
--cc=jgg@ziepe.ca \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
/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
all inboxes | Powered by JetHome®