diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-07-19 14:45:26 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:52:11 -0400 |
commit | da5503217d7421dbf04a0557d16cae6d5fc0960e (patch) | |
tree | 2244d419c6e13f4fc5af36071384a92a1751122d /drivers/block/cciss.c | |
parent | 4809d0988f10e305511d1a3e223880fa4b21f90e (diff) |
cciss: fix leak of ioremapped memory
cciss: fix leak of ioremapped memory
in cciss_pci_init error path.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index c297d31d0c97..b70247110608 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -4114,6 +4114,10 @@ static int __devinit cciss_pci_init(ctlr_info_t *c) | |||
4114 | if (err) | 4114 | if (err) |
4115 | goto err_out_free_res; | 4115 | goto err_out_free_res; |
4116 | c->vaddr = remap_pci_mem(c->paddr, 0x250); | 4116 | c->vaddr = remap_pci_mem(c->paddr, 0x250); |
4117 | if (!c->vaddr) { | ||
4118 | err = -ENOMEM; | ||
4119 | goto err_out_free_res; | ||
4120 | } | ||
4117 | err = cciss_wait_for_board_ready(c); | 4121 | err = cciss_wait_for_board_ready(c); |
4118 | if (err) | 4122 | if (err) |
4119 | goto err_out_free_res; | 4123 | goto err_out_free_res; |
@@ -4198,6 +4202,12 @@ err_out_free_res: | |||
4198 | * Deliberately omit pci_disable_device(): it does something nasty to | 4202 | * Deliberately omit pci_disable_device(): it does something nasty to |
4199 | * Smart Array controllers that pci_enable_device does not undo | 4203 | * Smart Array controllers that pci_enable_device does not undo |
4200 | */ | 4204 | */ |
4205 | if (c->transtable) | ||
4206 | iounmap(c->transtable); | ||
4207 | if (c->cfgtable) | ||
4208 | iounmap(c->cfgtable); | ||
4209 | if (c->vaddr) | ||
4210 | iounmap(c->vaddr); | ||
4201 | pci_release_regions(c->pdev); | 4211 | pci_release_regions(c->pdev); |
4202 | return err; | 4212 | return err; |
4203 | } | 4213 | } |
@@ -4745,6 +4755,8 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev) | |||
4745 | pci_disable_msi(hba[i]->pdev); | 4755 | pci_disable_msi(hba[i]->pdev); |
4746 | #endif /* CONFIG_PCI_MSI */ | 4756 | #endif /* CONFIG_PCI_MSI */ |
4747 | 4757 | ||
4758 | iounmap(hba[i]->transtable); | ||
4759 | iounmap(hba[i]->cfgtable); | ||
4748 | iounmap(hba[i]->vaddr); | 4760 | iounmap(hba[i]->vaddr); |
4749 | 4761 | ||
4750 | pci_free_consistent(hba[i]->pdev, hba[i]->nr_cmds * sizeof(CommandList_struct), | 4762 | pci_free_consistent(hba[i]->pdev, hba[i]->nr_cmds * sizeof(CommandList_struct), |