media: platform: ti: Add missing check for devm_regulator_get
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Wed, 4 Jan 2023 08:55:37 +0000 (09:55 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 22 Jan 2023 08:26:33 +0000 (09:26 +0100)
Add check for the return value of devm_regulator_get since it may return
error pointer.

Fixes: 448de7e7850b ("[media] omap3isp: OMAP3 ISP core")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/ti/omap3isp/isp.c

index 1d40bb5..e7327e3 100644 (file)
@@ -2307,7 +2307,16 @@ static int isp_probe(struct platform_device *pdev)
 
        /* Regulators */
        isp->isp_csiphy1.vdd = devm_regulator_get(&pdev->dev, "vdd-csiphy1");
+       if (IS_ERR(isp->isp_csiphy1.vdd)) {
+               ret = PTR_ERR(isp->isp_csiphy1.vdd);
+               goto error;
+       }
+
        isp->isp_csiphy2.vdd = devm_regulator_get(&pdev->dev, "vdd-csiphy2");
+       if (IS_ERR(isp->isp_csiphy2.vdd)) {
+               ret = PTR_ERR(isp->isp_csiphy2.vdd);
+               goto error;
+       }
 
        /* Clocks
         *