From: Stephen M. Cameron Date: Thu, 19 Jan 2012 20:00:42 +0000 (-0600) Subject: [SCSI] hpsa: fix per device memory leak on driver unload X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=55e14e764df5e24bedf93220f1da167af8300c2f;p=mv-sheeva.git [SCSI] hpsa: fix per device memory leak on driver unload Signed-off-by: Stephen M. Cameron Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index b96962c3944..4dc9107456a 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),