lkml.org 
[lkml]   [2022]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next] usb: typec: ucsi: fix return value check in ucsi_acpi_probe()
On Mon, May 16, 2022 at 09:15:27PM +0800, Yang Yingliang wrote:
> If memremap() fails, it never returns NULL. Replace NULL check
> with IS_ERR().

There's already a fix pending for this:
https://patchwork.kernel.org/project/linux-usb/patch/YnjaDBXLmwouCB3M@kili/

thanks,

> Fixes: cdc3d2abf438 ("usb: typec: ucsi: acpi: Map the mailbox with memremap()")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/usb/typec/ucsi/ucsi_acpi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
> index 7455e3aff2be..8873c1644a29 100644
> --- a/drivers/usb/typec/ucsi/ucsi_acpi.c
> +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
> @@ -133,8 +133,8 @@ static int ucsi_acpi_probe(struct platform_device *pdev)
> }
>
> ua->base = devm_memremap(&pdev->dev, res->start, resource_size(res), MEMREMAP_WB);
> - if (!ua->base)
> - return -ENOMEM;
> + if (IS_ERR(ua->base))
> + return PTR_ERR(ua->base);
>
> ret = guid_parse(UCSI_DSM_UUID, &ua->guid);
> if (ret)

--
heikki

\
 
 \ /
  Last update: 2022-05-17 11:41    [W:0.069 / U:1.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site