lkml.org 
[lkml]   [2008]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/4] atmel-mci: Fix memory leak in atmci_regs_show
    Date
    The debugfs hook atmci_regs_show allocates a temporary buffer for
    storing a register snapshot, but it doesn't free it before returning.
    Plug this leak.

    Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
    ---
    drivers/mmc/host/atmel-mci.c | 2 ++
    1 files changed, 2 insertions(+), 0 deletions(-)

    diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
    index 6de773d..becca91 100644
    --- a/drivers/mmc/host/atmel-mci.c
    +++ b/drivers/mmc/host/atmel-mci.c
    @@ -218,6 +218,8 @@ static int atmci_regs_show(struct seq_file *s, void *v)
    atmci_show_status_reg(s, "SR", buf[MCI_SR / 4]);
    atmci_show_status_reg(s, "IMR", buf[MCI_IMR / 4]);

    + kfree(buf);
    +
    return 0;
    }

    --
    1.5.6.5


    \
     
     \ /
      Last update: 2008-09-19 21:13    [W:0.028 / U:0.368 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site