[media] staging: media: omap4iss: fix handling platform_get_irq result
authorAndrzej Hajda <a.hajda@samsung.com>
Thu, 24 Sep 2015 14:00:14 +0000 (11:00 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sat, 3 Oct 2015 14:34:20 +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/staging/media/omap4iss/iss.c

index 9bfb725b9986ccbe86bc3bf9069d2e9dbb5c524e..0b03cb7c59d5c25c06ff1416ef38e62ba1c08e3d 100644 (file)
@@ -1440,12 +1440,13 @@ static int iss_probe(struct platform_device *pdev)
                 iss_reg_read(iss, OMAP4_ISS_MEM_ISP_SYS1, ISP5_REVISION));
 
        /* Interrupt */
-       iss->irq_num = platform_get_irq(pdev, 0);
-       if (iss->irq_num <= 0) {
+       ret = platform_get_irq(pdev, 0);
+       if (ret <= 0) {
                dev_err(iss->dev, "No IRQ resource\n");
                ret = -ENODEV;
                goto error_iss;
        }
+       iss->irq_num = ret;
 
        if (devm_request_irq(iss->dev, iss->irq_num, iss_isr, IRQF_SHARED,
                             "OMAP4 ISS", iss)) {