Skip to content

Commit

Permalink
[SCSI] hpsa: fix per device memory leak on driver unload
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Stephen M. Cameron authored and James Bottomley committed Feb 19, 2012
1 parent 26b937b commit 55e14e7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/scsi/hpsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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),
Expand Down

0 comments on commit 55e14e7

Please sign in to comment.