From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org
Subject: Re: [PATCH -next] usb: typec: ucsi: fix return value check in ucsi_acpi_probe()
Date: Tue, 17 May 2022 12:20:33 +0300 [thread overview]
Message-ID: <da320390-b47f-27a3-06e6-c4f660a41873@gmail.com> (raw)
In-Reply-To: <20220516131527.999909-1-yangyingliang@huawei.com>
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@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)
MBR, Sergey
next prev parent reply other threads:[~2022-05-17 9:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-16 13:15 [PATCH -next] usb: typec: ucsi: fix return value check in ucsi_acpi_probe() Yang Yingliang
2022-05-17 9:20 ` Sergei Shtylyov [this message]
2022-05-17 9:40 ` Heikki Krogerus
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=da320390-b47f-27a3-06e6-c4f660a41873@gmail.com \
--to=sergei.shtylyov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--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