projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90d4025
)
atm: firestream: check the return value of ioremap() in fs_init()
author
Jia-Ju Bai
<baijiaju1990@gmail.com>
Fri, 25 Feb 2022 12:52:30 +0000
(
04:52
-0800)
committer
David S. Miller
<davem@davemloft.net>
Mon, 28 Feb 2022 11:36:01 +0000
(11:36 +0000)
The function ioremap() in fs_init() can fail, so its return value should
be checked.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/atm/firestream.c
patch
|
blob
|
history
diff --git
a/drivers/atm/firestream.c
b/drivers/atm/firestream.c
index 3bc3c314a467b0bb508ac4a9a63aafd06e789ac5..4f67404fe64c743c873f01e1cf1738667881ccde 100644
(file)
--- a/
drivers/atm/firestream.c
+++ b/
drivers/atm/firestream.c
@@
-1676,6
+1676,8
@@
static int fs_init(struct fs_dev *dev)
dev->hw_base = pci_resource_start(pci_dev, 0);
dev->base = ioremap(dev->hw_base, 0x1000);
+ if (!dev->base)
+ return 1;
reset_chip (dev);