From: Dan Carpenter <dan.carpenter@oracle.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Laurentiu Tudor <laurentiu.tudor@nxp.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Dmitry Torokhov <dtor@chromium.org>,
Suwan Kim <suwan.kim027@gmail.com>,
Raul E Rangel <rrangel@chromium.org>,
linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] usb/hcd: Fix a NULL vs IS_ERR() bug in usb_hcd_setup_local_mem()
Date: Fri, 7 Jun 2019 16:57:09 +0300 [thread overview]
Message-ID: <20190607135709.GC16718@mwanda> (raw)
The devm_memremap() function doesn't return NULL, it returns error
pointers.
Fixes: b0310c2f09bb ("USB: use genalloc for USB HCs with local memory")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/usb/core/hcd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index fe631d18c1ed..df8f358685e6 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -3052,8 +3052,8 @@ int usb_hcd_setup_local_mem(struct usb_hcd *hcd, phys_addr_t phys_addr,
local_mem = devm_memremap(hcd->self.sysdev, phys_addr,
size, MEMREMAP_WC);
- if (!local_mem)
- return -ENOMEM;
+ if (IS_ERR(local_mem))
+ return PTR_ERR(local_mem);
/*
* Here we pass a dma_addr_t but the arg type is a phys_addr_t.
--
2.20.1
next reply other threads:[~2019-06-07 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-07 13:57 Dan Carpenter [this message]
2019-06-11 8:02 ` [PATCH] usb/hcd: Fix a NULL vs IS_ERR() bug in usb_hcd_setup_local_mem() Sebastian Andrzej Siewior
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=20190607135709.GC16718@mwanda \
--to=dan.carpenter@oracle.com \
--cc=bigeasy@linutronix.de \
--cc=chunfeng.yun@mediatek.com \
--cc=dtor@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=laurentiu.tudor@nxp.com \
--cc=linux-usb@vger.kernel.org \
--cc=rrangel@chromium.org \
--cc=stern@rowland.harvard.edu \
--cc=suwan.kim027@gmail.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;
as well as URLs for NNTP newsgroup(s).