[PATCH] scsi/aha1740.c Handle scsi_add_host failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add scsi_add_host() failure handling for Adaptec aha1740 driver.

Signed-off-by: Ashutosh Naik <[email protected]>
diff -Naurp linux-2.6.15-git5-vanilla/drivers/scsi/aha1740.c linux-2.6.15-git5/drivers/scsi/aha1740.c
--- linux-2.6.15-git5-vanilla/drivers/scsi/aha1740.c	2006-01-03 08:51:10.000000000 +0530
+++ linux-2.6.15-git5/drivers/scsi/aha1740.c	2006-01-10 16:22:13.000000000 +0530
@@ -587,7 +587,7 @@ static struct scsi_host_template aha1740
 
 static int aha1740_probe (struct device *dev)
 {
-	int slotbase;
+	int slotbase, retval;
 	unsigned int irq_level, irq_type, translation;
 	struct Scsi_Host *shpnt;
 	struct aha1740_hostdata *host;
@@ -642,7 +642,13 @@ static int aha1740_probe (struct device 
 	}
 
 	eisa_set_drvdata (edev, shpnt);
-	scsi_add_host (shpnt, dev); /* XXX handle failure */
+	retval = scsi_add_host (shpnt, dev);
+	if (retval) {
+		printk(KERN_WARNING "aha1740: scsi_add_host failed\n");
+		scsi_host_put (shpnt);
+		return retval;
+	}
+		
 	scsi_scan_host (shpnt);
 	return 0;
 

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux