public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] cciss: handler scsi_add_host failure
@ 2005-01-05 20:22 Miller, Mike (OS Dev)
  2005-01-05 20:24 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Miller, Mike (OS Dev) @ 2005-01-05 20:22 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: jejb, linux-scsi

> From: Christoph Hellwig [mailto:hch@lst.de]
> 
> Mike, is this patch okay?

Christoph,
BTW, I meant to say thanks.

mikem

> 
> On Mon, Jan 03, 2005 at 02:24:31PM +0100, Christoph Hellwig wrote:
> > --- 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);
> ---end quoted text---
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: [PATCH] cciss: handler scsi_add_host failure
@ 2005-01-05 20:16 Miller, Mike (OS Dev)
  0 siblings, 0 replies; 6+ messages in thread
From: Miller, Mike (OS Dev) @ 2005-01-05 20:16 UTC (permalink / raw)
  To: Christoph Hellwig, ISS StorageDev; +Cc: jejb, linux-scsi

> From: Christoph Hellwig [mailto:hch@lst.de]
> 
> Mike, is this patch okay?
> 

Yes, this looks OK. It's something that was on my todo list that kept getting pushed down.

Signed-off-by: Mike Miller <mike.miller@hp.com>

> On Mon, Jan 03, 2005 at 02:24:31PM +0100, Christoph Hellwig wrote:
> > --- 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);
> ---end quoted text---
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH] cciss: handler scsi_add_host failure
@ 2005-01-03 13:24 Christoph Hellwig
  2005-01-05 19:49 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2005-01-03 13:24 UTC (permalink / raw)
  To: jejb; +Cc: linux-scsi

--- 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);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-02-10 13:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox