[SCSI] SCSI/aha1740: handle SCSI API errors
authorJeff Garzik <jeff@garzik.org>
Thu, 9 Nov 2006 03:56:19 +0000 (19:56 -0800)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Wed, 15 Nov 2006 22:38:58 +0000 (16:38 -0600)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/aha1740.c

index c3c38a7e8d32d091a3bbd7ee925d7e81bc1492d2..d7af9c63a04d66d2f4dd2536725c39a901fe7d6f 100644 (file)
@@ -586,7 +586,7 @@ static struct scsi_host_template aha1740_template = {
 
 static int aha1740_probe (struct device *dev)
 {
-       int slotbase;
+       int slotbase, rc;
        unsigned int irq_level, irq_type, translation;
        struct Scsi_Host *shpnt;
        struct aha1740_hostdata *host;
@@ -641,10 +641,16 @@ static int aha1740_probe (struct device *dev)
        }
 
        eisa_set_drvdata (edev, shpnt);
-       scsi_add_host (shpnt, dev); /* XXX handle failure */
+
+       rc = scsi_add_host (shpnt, dev);
+       if (rc)
+               goto err_irq;
+
        scsi_scan_host (shpnt);
        return 0;
 
+ err_irq:
+       free_irq(irq_level, shpnt);
  err_unmap:
        dma_unmap_single (&edev->dev, host->ecb_dma_addr,
                          sizeof (host->ecb), DMA_BIDIRECTIONAL);