[media] media: am437x-vpfe: fix handling platform_get_irq result
authorAndrzej Hajda <a.hajda@samsung.com>
Thu, 24 Sep 2015 14:00:13 +0000 (11:00 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sat, 3 Oct 2015 14:34:52 +0000 (11:34 -0300)
The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/am437x/am437x-vpfe.c

index 488d2754c27cf065d514aae864ea27ba37f0d821..6751aecda0a1015e6a1b1c63617538426e94110f 100644 (file)
@@ -2551,11 +2551,12 @@ static int vpfe_probe(struct platform_device *pdev)
        if (IS_ERR(ccdc->ccdc_cfg.base_addr))
                return PTR_ERR(ccdc->ccdc_cfg.base_addr);
 
-       vpfe->irq = platform_get_irq(pdev, 0);
-       if (vpfe->irq <= 0) {
+       ret = platform_get_irq(pdev, 0);
+       if (ret <= 0) {
                dev_err(&pdev->dev, "No IRQ resource\n");
                return -ENODEV;
        }
+       vpfe->irq = ret;
 
        ret = devm_request_irq(vpfe->pdev, vpfe->irq, vpfe_isr, 0,
                               "vpfe_capture0", vpfe);