lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 01/10] hpsa: fix per device memory leak on driver unload
    From
    Date
    From: Stephen M. Cameron <scameron@beardog.cce.hp.com>

    Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
    ---
    drivers/scsi/hpsa.c | 9 +++++++++
    1 files changed, 9 insertions(+), 0 deletions(-)

    diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
    index 3ecb703..e9b1aa8 100644
    --- a/drivers/scsi/hpsa.c
    +++ b/drivers/scsi/hpsa.c
    @@ -4480,6 +4480,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;
    @@ -4495,6 +4503,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),


    \
     
     \ /
      Last update: 2012-01-19 21:03    [W:3.882 / U:0.228 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site