]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
atmel-mci: Fix memory leak in atmci_regs_show
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Fri, 19 Sep 2008 19:09:28 +0000 (21:09 +0200)
committerPierre Ossman <drzeus@drzeus.cx>
Sat, 20 Sep 2008 10:11:48 +0000 (12:11 +0200)
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>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/host/atmel-mci.c

index 6de773d3a0cfde3d526f8dfdd2d41c9c3c7f56e9..becca914507020d412bd164dcf0286124a014782 100644 (file)
@@ -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;
 }