From: Christoph Hellwig <hch@lst.de>
To: mike.miller@hp.com, iss_storagedev@hp.com
Cc: jejb@steeleye.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] cciss: handler scsi_add_host failure
Date: Wed, 5 Jan 2005 20:49:18 +0100 [thread overview]
Message-ID: <20050105194918.GA6393@lst.de> (raw)
In-Reply-To: <20050103132431.GA22309@lst.de>
Mike, is this patch okay?
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---
next prev parent reply other threads:[~2005-01-05 19:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-03 13:24 [PATCH] cciss: handler scsi_add_host failure Christoph Hellwig
2005-01-05 19:49 ` Christoph Hellwig [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-01-05 20:16 Miller, Mike (OS Dev)
2005-01-05 20:22 Miller, Mike (OS Dev)
2005-01-05 20:24 ` Christoph Hellwig
2005-02-10 13:44 ` 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=20050105194918.GA6393@lst.de \
--to=hch@lst.de \
--cc=iss_storagedev@hp.com \
--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.