Commit 65df45c8 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] request_region in acornscsi.c

Rusty Russell <rusty@rustcorp.com.au>: 13) request_region check, 11-20:
parent 574faf0f
...@@ -2915,13 +2915,18 @@ int acornscsi_detect(Scsi_Host_Template * tpnt) ...@@ -2915,13 +2915,18 @@ int acornscsi_detect(Scsi_Host_Template * tpnt)
ecs[count]->irqaddr = (char *)ioaddr(host->card.io_intr); ecs[count]->irqaddr = (char *)ioaddr(host->card.io_intr);
ecs[count]->irqmask = 0x0a; ecs[count]->irqmask = 0x0a;
request_region(instance->io_port + 0x800, 2, "acornscsi(sbic)"); if (!request_region(instance->io_port + 0x800, 2, "acornscsi(sbic)"))
request_region(host->card.io_intr, 1, "acornscsi(intr)"); goto err_1;
request_region(host->card.io_page, 1, "acornscsi(page)"); if (!request_region(host->card.io_intr, 1, "acornscsi(intr)"))
goto err_2;
if (!request_region(host->card.io_page, 1, "acornscsi(page)"))
goto err_3;
#ifdef USE_DMAC #ifdef USE_DMAC
request_region(host->dma.io_port, 256, "acornscsi(dmac)"); if (!request_region(host->dma.io_port, 256, "acornscsi(dmac)"))
goto err_4;
#endif #endif
request_region(instance->io_port, 2048, "acornscsi(ram)"); if (!request_region(instance->io_port, 2048, "acornscsi(ram)"))
goto err_5;
if (request_irq(host->scsi.irq, acornscsi_intr, SA_INTERRUPT, "acornscsi", host)) { if (request_irq(host->scsi.irq, acornscsi_intr, SA_INTERRUPT, "acornscsi", host)) {
printk(KERN_CRIT "scsi%d: IRQ%d not free, interrupts disabled\n", printk(KERN_CRIT "scsi%d: IRQ%d not free, interrupts disabled\n",
...@@ -2934,6 +2939,20 @@ int acornscsi_detect(Scsi_Host_Template * tpnt) ...@@ -2934,6 +2939,20 @@ int acornscsi_detect(Scsi_Host_Template * tpnt)
++count; ++count;
} }
return count; return count;
err_5:
#ifdef USE_DMAC
release_region(host->dma.io_port, 256);
#endif
err_4:
release_region(host->card.io_page, 1);
err_3:
release_region(host->card.io_intr, 1);
err_2:
release_region(instance->io_port + 0x800, 2);
err_1:
scsi_unregister(instance);
return 0;
} }
/* /*
......
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