projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c74f27
)
ipack: add error handling for ioremap_nocache
author
Zhouyang Jia
<
[email protected]
>
Tue, 12 Jun 2018 03:07:21 +0000
(11:07 +0800)
committer
Greg Kroah-Hartman
<
[email protected]
>
Sat, 7 Jul 2018 15:19:27 +0000
(17:19 +0200)
When ioremap_nocache fails, the lack of error-handling code may
cause unexpected results.
This patch adds error-handling code after calling ioremap_nocache.
Signed-off-by: Zhouyang Jia <
[email protected]
>
Acked-by: Samuel Iglesias Gonsalvez <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/ipack/carriers/tpci200.c
patch
|
blob
|
history
diff --git
a/drivers/ipack/carriers/tpci200.c
b/drivers/ipack/carriers/tpci200.c
index a16b320739b4be0feed888eaf962b90a4b9b2690..8a9c169b6f99bb67555d313d09f605d257848c5d 100644
(file)
--- a/
drivers/ipack/carriers/tpci200.c
+++ b/
drivers/ipack/carriers/tpci200.c
@@
-304,6
+304,13
@@
static int tpci200_register(struct tpci200_board *tpci200)
ioremap_nocache(pci_resource_start(tpci200->info->pdev,
TPCI200_IP_INTERFACE_BAR),
TPCI200_IFACE_SIZE);
+ if (!tpci200->info->interface_regs) {
+ dev_err(&tpci200->info->pdev->dev,
+ "(bn 0x%X, sn 0x%X) failed to map driver user space!",
+ tpci200->info->pdev->bus->number,
+ tpci200->info->pdev->devfn);
+ goto out_release_mem8_space;
+ }
/* Initialize lock that protects interface_regs */
spin_lock_init(&tpci200->regs_lock);