* [PATCH] scsi/aha1740.c Handle scsi_add_host failure
@ 2006-01-10 12:21 Ashutosh Naik
2006-01-13 18:05 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Ashutosh Naik @ 2006-01-10 12:21 UTC (permalink / raw)
To: linux-scsi, linux-kernel, James.Bottomley, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 124 bytes --]
Add scsi_add_host() failure handling for Adaptec aha1740 driver.
Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
[-- Attachment #2: aha1740.txt --]
[-- Type: text/plain, Size: 897 bytes --]
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;
+ }
+
scsi_scan_host (shpnt);
return 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi/aha1740.c Handle scsi_add_host failure
2006-01-10 12:21 [PATCH] scsi/aha1740.c Handle scsi_add_host failure Ashutosh Naik
@ 2006-01-13 18:05 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2006-01-13 18:05 UTC (permalink / raw)
To: Ashutosh Naik; +Cc: linux-scsi, linux-kernel, James.Bottomley, Andrew Morton
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-01-13 18:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-10 12:21 [PATCH] scsi/aha1740.c Handle scsi_add_host failure Ashutosh Naik
2006-01-13 18:05 ` Christoph Hellwig
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®