From: Takeshi Yoshimura Date: Wed, 27 May 2015 14:28:14 +0000 (-0300) Subject: [media] ddbridge: Do not free_irq() if request_irq() failed X-Git-Tag: v4.14-rc1~4413^2~495 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25e057fdde3b33c0d18605ed27b59336a3441925;p=platform%2Fkernel%2Flinux-rpi.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index 9e3492e..0ac2dd3 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);