lkml.org 
[lkml]   [2006]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] scsi/arm/ecoscsi.c Handle scsi_add_host failure
Oops, Missed declaring the variable "retval". This one works for sure.
Please apply this patch and drop the previous one. Sorry about that.
-Ashutosh

Add scsi_add_host() failure handling for the ecoscsi driver.

Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
diff -Naurp linux-2.6.15-git5-vanilla/drivers/scsi/arm/ecoscsi.c linux-2.6.15-git5/drivers/scsi/arm/ecoscsi.c
--- linux-2.6.15-git5-vanilla/drivers/scsi/arm/ecoscsi.c 2006-01-03 08:51:10.000000000 +0530
+++ linux-2.6.15-git5/drivers/scsi/arm/ecoscsi.c 2006-01-10 18:23:12.000000000 +0530
@@ -174,7 +174,7 @@ static struct Scsi_Host *host;

static int __init ecoscsi_init(void)
{
-
+ int retval;
host = scsi_host_alloc(tpnt, sizeof(struct NCR5380_hostdata));
if (!host)
return 0;
@@ -203,7 +203,13 @@ static int __init ecoscsi_init(void)
NCR5380_print_options(host);
printk("\n");

- scsi_add_host(host, NULL); /* XXX handle failure */
+ retval = scsi_add_host(host, NULL);
+ if (retval) {
+ printk(KERN_WARNING "ecoscsi: scsi_add_host failed\n");
+ scsi_host_put(host);
+ return retval;
+ }
+
scsi_scan_host(host);
return 0;
\
 
 \ /
  Last update: 2006-01-10 14:08    [W:0.052 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site