Commit 1160d61b authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Martin K. Petersen

scsi: sni_53c710: Add IRQ check

The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to request_irq() (which takes
*unsigned* IRQ #s), causing it to fail with -EINVAL (overridden by -ENODEV
further below).  Stop calling request_irq() with the invalid IRQ #s.

Link: https://lore.kernel.org/r/8f4b8fa5-8251-b977-70a1-9099bcb4bb17@omprussia.ru
Fixes: c27d85f3 ("[SCSI] SNI RM 53c710 driver")
Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 14b32138
......@@ -58,6 +58,7 @@ static int snirm710_probe(struct platform_device *dev)
struct NCR_700_Host_Parameters *hostdata;
struct Scsi_Host *host;
struct resource *res;
int rc;
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!res)
......@@ -83,7 +84,9 @@ static int snirm710_probe(struct platform_device *dev)
goto out_kfree;
host->this_id = 7;
host->base = base;
host->irq = platform_get_irq(dev, 0);
host->irq = rc = platform_get_irq(dev, 0);
if (rc < 0)
goto out_put_host;
if(request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "snirm710", host)) {
printk(KERN_ERR "snirm710: request_irq failed!\n");
goto out_put_host;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment