Commit 6f0ce4df authored by Aditya Pakki's avatar Aditya Pakki Committed by Miquel Raynal

mtd: rawnand: vf610: Avoid a potential NULL pointer dereference

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: default avatarAditya Pakki <pakki001@umn.edu>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent e8495069
...@@ -850,6 +850,9 @@ static int vf610_nfc_probe(struct platform_device *pdev) ...@@ -850,6 +850,9 @@ static int vf610_nfc_probe(struct platform_device *pdev)
} }
of_id = of_match_device(vf610_nfc_dt_ids, &pdev->dev); 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; nfc->variant = (enum vf610_nfc_variant)of_id->data;
for_each_available_child_of_node(nfc->dev->of_node, child) { for_each_available_child_of_node(nfc->dev->of_node, child) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment