From: Jack Rosenthal <jrosenth@chromium.org>
To: Peng Wu <wupeng58@huawei.com>
Cc: jwerner@chromium.org, gregkh@linuxfoundation.org,
groeck@chromium.org, linux-kernel@vger.kernel.org,
liwei391@huawei.com
Subject: Re: [PATCH -next] firmware: google: fix a NULL vs IS_ERR() check in cbmem_entry_probe()
Date: Tue, 15 Nov 2022 10:01:42 -0700 [thread overview]
Message-ID: <Y3PF9k8/ofe8EatQ@chromium.org> (raw)
In-Reply-To: <20221115091138.51614-1-wupeng58@huawei.com>
On 2022-11-15 at 09:11 +0000, Peng Wu wrote:
> The devm_memremap() function returns error pointers on error,
> it doesn't return NULL.
>
> Fixes: 19d54020883c ("firmware: google: Implement cbmem in sysfs driver")
> Signed-off-by: Peng Wu <wupeng58@huawei.com>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
> ---
> drivers/firmware/google/cbmem.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/google/cbmem.c b/drivers/firmware/google/cbmem.c
> index 685f3070ce9d..88e587ba1e0d 100644
> --- a/drivers/firmware/google/cbmem.c
> +++ b/drivers/firmware/google/cbmem.c
> @@ -106,8 +106,8 @@ static int cbmem_entry_probe(struct coreboot_device *dev)
> entry->mem_file_buf = devm_memremap(&dev->dev, dev->cbmem_entry.address,
> dev->cbmem_entry.entry_size,
> MEMREMAP_WB);
> - if (!entry->mem_file_buf)
> - return -ENOMEM;
> + if (IS_ERR(entry->mem_file_buf))
> + return PTR_ERR(entry->mem_file_buf);
>
> entry->size = dev->cbmem_entry.entry_size;
>
> --
> 2.17.1
>
prev parent reply other threads:[~2022-11-15 17:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 9:11 [PATCH -next] firmware: google: fix a NULL vs IS_ERR() check in cbmem_entry_probe() Peng Wu
2022-11-15 13:52 ` Guenter Roeck
2022-11-15 17:01 ` Jack Rosenthal [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=Y3PF9k8/ofe8EatQ@chromium.org \
--to=jrosenth@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=jwerner@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liwei391@huawei.com \
--cc=wupeng58@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