[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABXOdTcDuugW7t=MV_1Cy2cbe6GC4dUn_=4VmrYHobLzx1uscA@mail.gmail.com>
Date: Tue, 15 Nov 2022 05:52:15 -0800
From: Guenter Roeck <groeck@...gle.com>
To: Peng Wu <wupeng58@...wei.com>
Cc: jwerner@...omium.org, jrosenth@...omium.org,
gregkh@...uxfoundation.org, groeck@...omium.org,
linux-kernel@...r.kernel.org, liwei391@...wei.com
Subject: Re: [PATCH -next] firmware: google: fix a NULL vs IS_ERR() check in cbmem_entry_probe()
On Tue, Nov 15, 2022 at 1:14 AM Peng Wu <wupeng58@...wei.com> 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@...wei.com>
Reviewed-by: Guenter Roeck <groeck@...omium.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
>
Powered by blists - more mailing lists