From: Dan Carpenter <dan.carpenter@oracle.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] usb: typec: ucsi: acpi: fix a NULL vs IS_ERR() check in probe
Date: Mon, 9 May 2022 12:08:28 +0300 [thread overview]
Message-ID: <YnjaDBXLmwouCB3M@kili> (raw)
The devm_memremap() function never returns NULL. It returns error
pointers.
Fixes: cdc3d2abf438 ("usb: typec: ucsi: acpi: Map the mailbox with memremap()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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)
--
2.35.1
next reply other threads:[~2022-05-09 9:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 9:08 Dan Carpenter [this message]
2022-05-09 13:14 ` [PATCH] usb: typec: ucsi: acpi: fix a NULL vs IS_ERR() check in probe Heikki Krogerus
2022-05-12 9:36 ` Greg Kroah-Hartman
2022-05-30 16:10 ` Rafael J. Wysocki
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=YnjaDBXLmwouCB3M@kili \
--to=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rafael.j.wysocki@intel.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