]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/soc/mediatek/mtk-pmic-wrap.c
soc: mediatek: PMIC wrap: Fix possible NULL derefrence.
[mirror_ubuntu-artful-kernel.git] / drivers / soc / mediatek / mtk-pmic-wrap.c
index 285b434449a640af4a7e68bddfdbc840f97c36a5..c80a04e1b2b16f83c60759b74f26fa9ad44727e4 100644 (file)
@@ -1117,6 +1117,11 @@ static int pwrap_probe(struct platform_device *pdev)
        const struct of_device_id *of_slave_id = NULL;
        struct resource *res;
 
+       if (!of_id) {
+               dev_err(&pdev->dev, "Error: No device match found\n");
+               return -ENODEV;
+       }
+
        if (pdev->dev.of_node->child)
                of_slave_id = of_match_node(of_slave_match_tbl,
                                            pdev->dev.of_node->child);