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:
002181f
)
mtd: devices: docg3: check the return value of devm_ioremap() in the probe
author
William Dean
<williamsukatube@gmail.com>
Fri, 22 Jul 2022 09:16:44 +0000
(17:16 +0800)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Mon, 19 Sep 2022 16:14:38 +0000
(18:14 +0200)
The function devm_ioremap() in docg3_probe() can fail, so
its return value should be checked.
Fixes: 82402aeb8c81e ("mtd: docg3: Use devm_*() functions")
Reported-by: Hacash Robot <hacashRobot@santino.com>
Signed-off-by: William Dean <williamsukatube@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link:
https://lore.kernel.org/linux-mtd/20220722091644.2937953-1-williamsukatube@163.com
drivers/mtd/devices/docg3.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/devices/docg3.c
b/drivers/mtd/devices/docg3.c
index 5b0ae5ddad74554799cd4f2ede229b3f3f6eb7e8..27c08f22dec8c054d744b1f68454e72baa0ef1a6 100644
(file)
--- a/
drivers/mtd/devices/docg3.c
+++ b/
drivers/mtd/devices/docg3.c
@@
-1974,9
+1974,14
@@
static int __init docg3_probe(struct platform_device *pdev)
dev_err(dev, "No I/O memory resource defined\n");
return ret;
}
- base = devm_ioremap(dev, ress->start, DOC_IOSPACE_SIZE);
ret = -ENOMEM;
+ base = devm_ioremap(dev, ress->start, DOC_IOSPACE_SIZE);
+ if (!base) {
+ dev_err(dev, "devm_ioremap dev failed\n");
+ return ret;
+ }
+
cascade = devm_kcalloc(dev, DOC_MAX_NBFLOORS, sizeof(*cascade),
GFP_KERNEL);
if (!cascade)