From: Christoph Hellwig <hch@infradead.org>
To: Ashutosh Naik <ashutosh.naik@gmail.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
James.Bottomley@steeleye.com, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] scsi/aha1740.c Handle scsi_add_host failure
Date: Fri, 13 Jan 2006 18:05:43 +0000 [thread overview]
Message-ID: <20060113180543.GA20718@infradead.org> (raw)
In-Reply-To: <81083a450601100421t5f8fcc4am2c0ec666feccc4ca@mail.gmail.com>
On Tue, Jan 10, 2006 at 05:51:15PM +0530, Ashutosh Naik wrote:
> Add scsi_add_host() failure handling for Adaptec aha1740 driver.
>
> Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
> diff -Naurp linux-2.6.15-git5-vanilla/drivers/scsi/aha1740.c linux-2.6.15-git5/drivers/scsi/aha1740.c
> --- linux-2.6.15-git5-vanilla/drivers/scsi/aha1740.c 2006-01-03 08:51:10.000000000 +0530
> +++ linux-2.6.15-git5/drivers/scsi/aha1740.c 2006-01-10 16:22:13.000000000 +0530
> @@ -587,7 +587,7 @@ static struct scsi_host_template aha1740
>
> static int aha1740_probe (struct device *dev)
> {
> - int slotbase;
> + int slotbase, retval;
> unsigned int irq_level, irq_type, translation;
> struct Scsi_Host *shpnt;
> struct aha1740_hostdata *host;
> @@ -642,7 +642,13 @@ static int aha1740_probe (struct device
> }
>
> eisa_set_drvdata (edev, shpnt);
> - scsi_add_host (shpnt, dev); /* XXX handle failure */
> + retval = scsi_add_host (shpnt, dev);
> + if (retval) {
> + printk(KERN_WARNING "aha1740: scsi_add_host failed\n");
> + scsi_host_put (shpnt);
> + return retval;
> + }
> +
this is wrong. you need to add a new err_free_irq label that frees
the allocated irq and then falls through to the existing error handling
code, starting at the err_unmap label.
prev parent reply other threads:[~2006-01-13 18:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-10 12:21 Ashutosh Naik
2006-01-13 18:05 ` Christoph Hellwig [this message]
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=20060113180543.GA20718@infradead.org \
--to=hch@infradead.org \
--cc=James.Bottomley@steeleye.com \
--cc=akpm@osdl.org \
--cc=ashutosh.naik@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®