Skip to content

Commit

Permalink
atmel-mci: Fix memory leak in atmci_regs_show
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Haavard Skinnemoen authored and Pierre Ossman committed Sep 20, 2008
1 parent 87e60f2 commit b17339a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mmc/host/atmel-mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b17339a

Please sign in to comment.