Commit b17339a1 authored by Haavard Skinnemoen's avatar Haavard Skinnemoen Committed by Pierre Ossman

atmel-mci: Fix memory leak in atmci_regs_show

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: default avatarHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 87e60f2b
...@@ -218,6 +218,8 @@ static int atmci_regs_show(struct seq_file *s, void *v) ...@@ -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, "SR", buf[MCI_SR / 4]);
atmci_show_status_reg(s, "IMR", buf[MCI_IMR / 4]); atmci_show_status_reg(s, "IMR", buf[MCI_IMR / 4]);
kfree(buf);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment