lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <da320390-b47f-27a3-06e6-c4f660a41873@gmail.com>
Date:   Tue, 17 May 2022 12:20:33 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...il.com>
To:     Yang Yingliang <yangyingliang@...wei.com>,
        linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Cc:     heikki.krogerus@...ux.intel.com, gregkh@...uxfoundation.org
Subject: Re: [PATCH -next] usb: typec: ucsi: fix return value check in
 ucsi_acpi_probe()

Hello!

On 5/16/22 4:15 PM, Yang Yingliang wrote:

> If memremap() fails, it never returns NULL. Replace NULL check

   Oh, memremap() does! But devm_memremap() doesn't, indeed. :-)

> with IS_ERR().
> 
> Fixes: cdc3d2abf438 ("usb: typec: ucsi: acpi: Map the mailbox with memremap()")
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.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)

MBR, Sergey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ