]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
[SCSI] hpsa: fix per device memory leak on driver unload
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Thu, 19 Jan 2012 20:00:42 +0000 (14:00 -0600)
committerJoe Jin <joe.jin@oracle.com>
Tue, 15 May 2012 08:01:17 +0000 (16:01 +0800)
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 55e14e764df5e24bedf93220f1da167af8300c2f)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/scsi/hpsa.c

index 6309de72be9266f32dea9a6b1b46f7aa02019b2e..7763b4473ca95e9865061eff334c6954ac1f8623 100644 (file)
@@ -4511,6 +4511,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;
@@ -4526,6 +4534,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),