summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-07-19 13:45:26 -0500
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 18:52:11 +0200
commitda5503217d7421dbf04a0557d16cae6d5fc0960e (patch)
tree2244d419c6e13f4fc5af36071384a92a1751122d
parent4809d0988f10e305511d1a3e223880fa4b21f90e (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>
-rw-r--r--drivers/block/cciss.c12
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)
if (err)
goto err_out_free_res;
c->vaddr = remap_pci_mem(c->paddr, 0x250);
+ if (!c->vaddr) {
+ err = -ENOMEM;
+ goto err_out_free_res;
+ }
err = cciss_wait_for_board_ready(c);
if (err)
goto err_out_free_res;
@@ -4198,6 +4202,12 @@ err_out_free_res:
* Deliberately omit pci_disable_device(): it does something nasty to
* Smart Array controllers that pci_enable_device does not undo
*/
+ if (c->transtable)
+ iounmap(c->transtable);
+ if (c->cfgtable)
+ iounmap(c->cfgtable);
+ if (c->vaddr)
+ iounmap(c->vaddr);
pci_release_regions(c->pdev);
return err;
}
@@ -4745,6 +4755,8 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev)
pci_disable_msi(hba[i]->pdev);
#endif /* CONFIG_PCI_MSI */
+ iounmap(hba[i]->transtable);
+ iounmap(hba[i]->cfgtable);
iounmap(hba[i]->vaddr);
pci_free_consistent(hba[i]->pdev, hba[i]->nr_cmds * sizeof(CommandList_struct),