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>
        }
 
        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) {