From: Jesper Juhl Date: Wed, 14 Dec 2005 18:27:20 +0000 (+0100) Subject: [SCSI] handle scsi_add_host failure for aic7xxx and fix compiler warning X-Git-Tag: v2.6.16-rc1~474^2~22^2~8^2~20 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e1fe9314cb5649b2dc73690f2cd8d0068e633d9;p=linux-2.6 [SCSI] handle scsi_add_host failure for aic7xxx and fix compiler warning Add scsi_add_host() failure handling for aic7xxx Also silence a compiler warning : drivers/scsi/aic7xxx/aic7xxx_osm.c: In function `ahc_linux_register_host': drivers/scsi/aic7xxx/aic7xxx_osm.c:1100: warning: ignoring return value of `scsi_add_host', declared with attribute warn_unused_result Signed-off-by: Jesper Juhl Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index d866213f42..fd389e9f94 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -1061,10 +1061,11 @@ uint32_t aic7xxx_verbose; int ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *template) { - char buf[80]; - struct Scsi_Host *host; + char buf[80]; + struct Scsi_Host *host; char *new_name; - u_long s; + u_long s; + int retval; template->name = ahc->description; host = scsi_host_alloc(template, sizeof(struct ahc_softc *)); @@ -1097,9 +1098,16 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa host->transportt = ahc_linux_transport_template; - scsi_add_host(host, (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); /* XXX handle failure */ + retval = scsi_add_host(host, + (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); + if (retval) { + printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n"); + scsi_host_put(host); + return retval; + } + scsi_scan_host(host); - return (0); + return 0; } /*