All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Miller, Mike (OS Dev)" <mike.miller@hp.com>
Cc: jejb@steeleye.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] cciss: handler scsi_add_host failure
Date: Thu, 10 Feb 2005 14:44:13 +0100	[thread overview]
Message-ID: <20050210134413.GA5804@lst.de> (raw)
In-Reply-To: <20050105202423.GA7043@lst.de>

On Wed, Jan 05, 2005 at 09:24:23PM +0100, Christoph Hellwig wrote:
> On Wed, Jan 05, 2005 at 02:22:22PM -0600, Miller, Mike (OS Dev) wrote:
> > > From: Christoph Hellwig [mailto:hch@lst.de]
> > > 
> > > Mike, is this patch okay?
> > 
> > Christoph,
> > BTW, I meant to say thanks.
> 
> You're welcome :)

James, can you put this patch in?


--- 1.23/drivers/block/cciss_scsi.c	2004-10-14 16:15:25 +02:00
+++ edited/drivers/block/cciss_scsi.c	2004-12-31 14:42:51 +01:00
@@ -691,14 +691,13 @@ static int
 cciss_scsi_detect(int ctlr)
 {
 	struct Scsi_Host *sh;
+	int error;
 
 	sh = scsi_host_alloc(&cciss_driver_template, sizeof(struct ctlr_info *));
 	if (sh == NULL)
-		return 0;
-
+		goto fail;
 	sh->io_port = 0;	// good enough?  FIXME, 
 	sh->n_io_port = 0;	// I don't think we use these two...
-
 	sh->this_id = SELF_SCSI_ID;  
 
 	((struct cciss_scsi_adapter_data_t *) 
@@ -706,10 +705,16 @@ cciss_scsi_detect(int ctlr)
 	sh->hostdata[0] = (unsigned long) hba[ctlr];
 	sh->irq = hba[ctlr]->intr;
 	sh->unique_id = sh->irq;
-	scsi_add_host(sh, &hba[ctlr]->pdev->dev); /* XXX handle failure */
+	error = scsi_add_host(sh, &hba[ctlr]->pdev->dev);
+	if (error)
+		goto fail_host_put;
 	scsi_scan_host(sh);
-
 	return 1;
+
+ fail_host_put:
+	scsi_host_put(sh);
+ fail:
+	return 0;
 }
 
 static void __exit cleanup_cciss_module(void);

  reply	other threads:[~2005-02-10 13:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-05 20:22 [PATCH] cciss: handler scsi_add_host failure Miller, Mike (OS Dev)
2005-01-05 20:24 ` Christoph Hellwig
2005-02-10 13:44   ` Christoph Hellwig [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-05 20:16 Miller, Mike (OS Dev)
2005-01-03 13:24 Christoph Hellwig
2005-01-05 19:49 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050210134413.GA5804@lst.de \
    --to=hch@lst.de \
    --cc=jejb@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mike.miller@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.