[PATCH 2.6.13] Unhandled error condition in aic79xx

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

 



This patch should handle the case when scsi_add_host() fails.

Signed-Off-By: Daniel Walker <[email protected]>

Index: linux-2.6.13/drivers/scsi/aic7xxx/aic79xx_osm.c
===================================================================
--- linux-2.6.13.orig/drivers/scsi/aic7xxx/aic79xx_osm.c	2005-08-28 23:41:01.000000000 +0000
+++ linux-2.6.13/drivers/scsi/aic7xxx/aic79xx_osm.c	2005-08-31 18:49:09.000000000 +0000
@@ -1989,6 +1989,7 @@ ahd_linux_register_host(struct ahd_softc
 	char	*new_name;
 	u_long	s;
 	u_long	target;
+	int error = 0;
 
 	template->name = ahd->description;
 	host = scsi_host_alloc(template, sizeof(struct ahd_softc *));
@@ -2065,7 +2066,11 @@ ahd_linux_register_host(struct ahd_softc
 	ahd_unlock(ahd, &s);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-	scsi_add_host(host, &ahd->dev_softc->dev); /* XXX handle failure */
+	error = scsi_add_host(host, &ahd->dev_softc->dev); 
+	if (error) {
+		scsi_host_put(host);
+		return(error);
+	}
 	scsi_scan_host(host);
 #endif
 	return (0);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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