]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[media] ddbridge: Do not free_irq() if request_irq() failed
authorTakeshi Yoshimura <yos@sslab.ics.keio.ac.jp>
Wed, 27 May 2015 14:28:14 +0000 (11:28 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 9 Jun 2015 22:40:33 +0000 (19:40 -0300)
My static checker detected that free_irq() is called even after
request_irq() failed in ddb_probe(). In this case, the kernel may try to
free dev->pdev->irq although the IRQ is not assigned. This event rarely
occurs, but always introduces a warning if it happens.

"goto fail1" always results in disabling enabled MSI and releasing a
requested IRQ. It seems like the former handling is necessary. So I added
a conditional branch before the free_irq() (stat == 0 means request_irq()
succeeds).

Signed-off-by: Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/ddbridge/ddbridge-core.c

index 9e3492e2076609ff0339484186422980cee3d920..0ac2dd35fe506480d5e99475bc9200fa26147408 100644 (file)
@@ -1630,7 +1630,8 @@ fail1:
        printk(KERN_ERR "fail1\n");
        if (dev->msi)
                pci_disable_msi(dev->pdev);
-       free_irq(dev->pdev->irq, dev);
+       if (stat == 0)
+               free_irq(dev->pdev->irq, dev);
 fail:
        printk(KERN_ERR "fail\n");
        ddb_unmap(dev);