mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
usb/hcd: Fix a NULL vs IS_ERR() bug in usb_hcd_setup_local_mem()
The devm_memremap() function doesn't return NULL, it returns error
pointers.
Fixes: b0310c2f09
("USB: use genalloc for USB HCs with local memory")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20190607135709.GC16718@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d74ffae8b8
commit
94b9a70d32
1 changed files with 2 additions and 2 deletions
|
@ -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,
|
local_mem = devm_memremap(hcd->self.sysdev, phys_addr,
|
||||||
size, MEMREMAP_WC);
|
size, MEMREMAP_WC);
|
||||||
if (!local_mem)
|
if (IS_ERR(local_mem))
|
||||||
return -ENOMEM;
|
return PTR_ERR(local_mem);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Here we pass a dma_addr_t but the arg type is a phys_addr_t.
|
* Here we pass a dma_addr_t but the arg type is a phys_addr_t.
|
||||||
|
|
Loading…
Add table
Reference in a new issue