projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e849506
)
mtd: rawnand: vf610: Avoid a potential NULL pointer dereference
author
Aditya Pakki
<pakki001@umn.edu>
Mon, 18 Mar 2019 23:24:34 +0000
(18:24 -0500)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Mon, 8 Apr 2019 08:21:07 +0000
(10:21 +0200)
of_match_device can return NULL if there is no matching device. Avoid
a potential NULL pointer dereference by checking for the return value
and passing the error upstream.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/vf610_nfc.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mtd/nand/raw/vf610_nfc.c
b/drivers/mtd/nand/raw/vf610_nfc.c
index a662ca1970e587d8f8460c879d9c774772a823dc..6d43ddb3332f499e0067f41ffc57aba4a1638deb 100644
(file)
--- a/
drivers/mtd/nand/raw/vf610_nfc.c
+++ b/
drivers/mtd/nand/raw/vf610_nfc.c
@@
-850,6
+850,9
@@
static int vf610_nfc_probe(struct platform_device *pdev)
}
of_id = of_match_device(vf610_nfc_dt_ids, &pdev->dev);
+ if (!of_id)
+ return -ENODEV;
+
nfc->variant = (enum vf610_nfc_variant)of_id->data;
for_each_available_child_of_node(nfc->dev->of_node, child) {