From: Jarkko Sakkinen <jarkko@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-integrity@vger.kernel.org, peterhuewe@gmx.de, jgg@ziepe.ca,
eajames@linux.ibm.com
Subject: Re: [PATCH -next] tpm: of: fix return value check in tpm_read_log_memory_region()
Date: Wed, 8 Feb 2023 03:18:39 +0200 [thread overview]
Message-ID: <Y+L4b2rLYUe8091O@kernel.org> (raw)
In-Reply-To: <20230129072637.279576-1-yangyingliang@huawei.com>
On Sun, Jan 29, 2023 at 03:26:37PM +0800, Yang Yingliang wrote:
> devm_memremap() never returns NULL pointer, it will return
> ERR_PTR() when it fails, so replace the check with IS_ERR().
>
> Fixes: b0474a20b153 ("tpm: Add reserved memory event log")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/char/tpm/eventlog/of.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/tpm/eventlog/of.c b/drivers/char/tpm/eventlog/of.c
> index c815cadf00a4..6a818a026c94 100644
> --- a/drivers/char/tpm/eventlog/of.c
> +++ b/drivers/char/tpm/eventlog/of.c
> @@ -43,7 +43,7 @@ static int tpm_read_log_memory_region(struct tpm_chip *chip)
>
> chip->log.bios_event_log = devm_memremap(&chip->dev, res.start, resource_size(&res),
> MEMREMAP_WB);
> - if (!chip->log.bios_event_log) {
> + if (IS_ERR(chip->log.bios_event_log)) {
> dev_info(&chip->dev, "err memremap\n");
> return -ENOMEM;
> }
> --
> 2.25.1
>
Thanks. I will squash this with the patch and add your sob.
BR, Jarkko
next prev parent reply other threads:[~2023-02-08 1:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-29 7:26 [PATCH -next] tpm: of: fix return value check in tpm_read_log_memory_region() Yang Yingliang
2023-02-08 1:18 ` Jarkko Sakkinen [this message]
2023-02-08 1:26 ` Jarkko Sakkinen
2023-02-08 1:31 ` Jarkko Sakkinen
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=Y+L4b2rLYUe8091O@kernel.org \
--to=jarkko@kernel.org \
--cc=eajames@linux.ibm.com \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=yangyingliang@huawei.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).