Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03ce11048b3832f5f0c471ccdb3363a870a14ac1
Commit:     03ce11048b3832f5f0c471ccdb3363a870a14ac1
Parent:     c1158e63dfeb3928e94c768f0a403b3e0e799f70
Author:     Reiner Sailer <[EMAIL PROTECTED]>
AuthorDate: Fri Jul 20 10:03:02 2007 -0400
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Jul 20 12:00:04 2007 -0700

    Fix memory leak in tpm_binary_bios_measurements_open()
    
    The same problem that was fixed for tpm_ascii_bios_measurements_open()
    in commit 178554ae75739e91dc4d7c3e42a3db95448cc5bf also occurs in
    tpm_binary_bios measurements().  Thanks for noticing this Satyam!
    
    I tested the attached patch to fix tpm_binary_bios_measurments as well.
    
    Signed-off-by: Reiner Sailer <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/char/tpm/tpm_bios.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c
index 4b26ce4..8677fc6 100644
--- a/drivers/char/tpm/tpm_bios.c
+++ b/drivers/char/tpm/tpm_bios.c
@@ -465,7 +465,7 @@ static int tpm_binary_bios_measurements_open(struct inode 
*inode,
                return -ENOMEM;
 
        if ((err = read_log(log)))
-               return err;
+               goto out_free;
 
        /* now register seq file */
        err = seq_open(file, &tpm_binary_b_measurments_seqops);
@@ -473,10 +473,15 @@ static int tpm_binary_bios_measurements_open(struct inode 
*inode,
                seq = file->private_data;
                seq->private = log;
        } else {
-               kfree(log->bios_event_log);
-               kfree(log);
+               goto out_free;
        }
+
+out:
        return err;
+out_free:
+       kfree(log->bios_event_log);
+       kfree(log);
+       goto out;
 }
 
 const struct file_operations tpm_binary_bios_measurements_ops = {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to