diff options
author | Takeshi Yoshimura <yos@sslab.ics.keio.ac.jp> | 2015-05-27 11:28:14 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-06-09 19:40:33 -0300 |
commit | 25e057fdde3b33c0d18605ed27b59336a3441925 (patch) | |
tree | 4ce35fd6ea668fa65b52ddbb9d1f0e75958e501d /drivers/media/pci/ddbridge/ddbridge-core.c | |
parent | ee8defeceafa05401573f3d2f1e3feca33e5a83c (diff) | |
download | blackbird-op-linux-25e057fdde3b33c0d18605ed27b59336a3441925.tar.gz blackbird-op-linux-25e057fdde3b33c0d18605ed27b59336a3441925.zip |
[media] ddbridge: Do not free_irq() if request_irq() failed
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>
Diffstat (limited to 'drivers/media/pci/ddbridge/ddbridge-core.c')
-rw-r--r-- | drivers/media/pci/ddbridge/ddbridge-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 9e3492e20766..0ac2dd35fe50 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -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); |