lkml.org 
[lkml]   [2003]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: cciss error handling patch for 2.6.0-test4
mike.miller@hp.com wrote:
>
> This patch was built & tested using 2.6.0-test4. It _hopefully_ cleans up the error handling in cciss_init_one().
> Please consider this for inclusion in the 2.6.0 kernel.
>
> Thanks,
> mikem
> ------------------------------------------------------------------------------
> diff -burN lx260test4-p1/drivers/block/cciss.c lx260test4/drivers/block/cciss.c
> --- lx260test4-p1/drivers/block/cciss.c 2003-08-26 13:09:45.000000000 -0500
> +++ lx260test4/drivers/block/cciss.c 2003-08-26 14:01:12.000000000 -0500
> @@ -2447,11 +2447,8 @@
> if( i < 0 )
> return (-1);
> if (cciss_pci_init(hba[i], pdev) != 0)
> - {
> - release_io_mem(hba[i]);
> - free_hba(i);
> - return (-1);
> - }
> + goto clean1;
> +
> sprintf(hba[i]->devname, "cciss%d", i);
> hba[i]->ctlr = i;
> hba[i]->pdev = pdev;
> @@ -2463,28 +2460,23 @@
> printk("cciss: not using DAC cycles\n");
> else {
> printk("cciss: no suitable DMA available\n");
> - free_hba(i);
> - return -ENODEV;
> + goto clean0;
> }

But that change propagates an existing bug: a missing release_iomem().
This additional change is needed.

diff -puN drivers/block/cciss.c~cciss-error-handling-cleanup-fix drivers/block/cciss.c
--- 25/drivers/block/cciss.c~cciss-error-handling-cleanup-fix Wed Sep 3 15:31:30 2003
+++ 25-akpm/drivers/block/cciss.c Wed Sep 3 15:31:40 2003
@@ -2460,7 +2460,7 @@ static int __init cciss_init_one(struct
printk("cciss: not using DAC cycles\n");
else {
printk("cciss: no suitable DMA available\n");
- goto clean0;
+ goto clean1;
}

if (register_blkdev(COMPAQ_CISS_MAJOR+i, hba[i]->devname)) {
@@ -2568,7 +2568,6 @@ clean2:
unregister_blkdev(COMPAQ_CISS_MAJOR+i, hba[i]->devname);
clean1:
release_io_mem(hba[i]);
-clean0:
free_hba(i);
return(-1);
}
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.103 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site