media: mx2_emmaprp: Check for platform_get_irq() error
authorFabio Estevam <fabio.estevam@nxp.com>
Thu, 17 Aug 2017 21:12:05 +0000 (17:12 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 27 Aug 2017 11:50:48 +0000 (07:50 -0400)
platform_get_irq() may fail, so we should better check its return
value and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/mx2_emmaprp.c

index 7fd209e51140dd9f04a2cf7549ddbec31183a340..92124ffc4d8b35644fe33d7b9e6160d054a7ce8f 100644 (file)
@@ -942,6 +942,8 @@ static int emmaprp_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, pcdev);
 
        irq = platform_get_irq(pdev, 0);
+       if (irq < 0)
+               return irq;
        ret = devm_request_irq(&pdev->dev, irq, emmaprp_irq, 0,
                               dev_name(&pdev->dev), pcdev);
        if (ret)