aboutsummaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorKylene Jo Hall <kjhall@us.ibm.com>2006-04-22 02:36:35 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-22 09:19:53 -0700
commit59e89f3a091d5cf93f4b176aedcfded61ece5252 (patch)
tree927003d6297eb724ff220fb416aa357c25854221 /drivers/char
parentb9251b823b5e921c894eb135cb6c64abf483f50e (diff)
[PATCH] tpm: fix memory leak
The eventname was kmalloc'd and not freed in the *_show functions. This bug was found by Coverity. Signed-off-by: Kylene Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm_bios.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c
index 537aa45d8c6..0549e2a35df 100644
--- a/drivers/char/tpm/tpm_bios.c
+++ b/drivers/char/tpm/tpm_bios.c
@@ -306,6 +306,7 @@ static int tpm_binary_bios_measurements_show(struct seq_file *m, void *v)
/* 5th: delimiter */
seq_putc(m, '\0');
+ kfree(eventname);
return 0;
}
@@ -353,6 +354,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
/* 4th: eventname <= max + \'0' delimiter */
seq_printf(m, " %s\n", eventname);
+ kfree(eventname);
return 0;
}