From: Jeff Garzik Date: Thu, 9 Nov 2006 03:56:19 +0000 (-0800) Subject: [SCSI] SCSI/aha1740: handle SCSI API errors X-Git-Tag: v2.6.20-rc2~6^2~13^2~5^2~62 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=08157cd0787004e2ebf9ee8cc92257244da53848;p=linux-2.6-omap-h63xx.git [SCSI] SCSI/aha1740: handle SCSI API errors Signed-off-by: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c index c3c38a7e8d3..d7af9c63a04 100644 --- a/drivers/scsi/aha1740.c +++ b/drivers/scsi/aha1740.c @@ -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);