summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2012-01-19 14:00:42 -0600
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 08:08:55 -0600
commit55e14e764df5e24bedf93220f1da167af8300c2f (patch)
treeba75518670f75907a2780b5ef76bb3a1f42ab5aa /drivers/scsi/hpsa.c
parent26b937b2a349e9e6b294703232af264af7e277c4 (diff)
downloadlinux-55e14e764df5e24bedf93220f1da167af8300c2f.tar.gz
linux-55e14e764df5e24bedf93220f1da167af8300c2f.tar.bz2
linux-55e14e764df5e24bedf93220f1da167af8300c2f.zip
[SCSI] hpsa: fix per device memory leak on driver unload
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index b96962c39449..4dc9107456ae 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4482,6 +4482,14 @@ static void hpsa_shutdown(struct pci_dev *pdev)
#endif /* CONFIG_PCI_MSI */
}
+static void __devexit hpsa_free_device_info(struct ctlr_info *h)
+{
+ int i;
+
+ for (i = 0; i < h->ndevices; i++)
+ kfree(h->dev[i]);
+}
+
static void __devexit hpsa_remove_one(struct pci_dev *pdev)
{
struct ctlr_info *h;
@@ -4497,6 +4505,7 @@ static void __devexit hpsa_remove_one(struct pci_dev *pdev)
iounmap(h->vaddr);
iounmap(h->transtable);
iounmap(h->cfgtable);
+ hpsa_free_device_info(h);
hpsa_free_sg_chain_blocks(h);
pci_free_consistent(h->pdev,
h->nr_cmds * sizeof(struct CommandList),