diff options
Diffstat (limited to 'drivers/char/tpm/tpm_bios.c')
-rw-r--r-- | 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 4eba32b23b29..4b26ce48189b 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c | |||
@@ -427,7 +427,7 @@ static int tpm_ascii_bios_measurements_open(struct inode *inode, | |||
427 | return -ENOMEM; | 427 | return -ENOMEM; |
428 | 428 | ||
429 | if ((err = read_log(log))) | 429 | if ((err = read_log(log))) |
430 | return err; | 430 | goto out_free; |
431 | 431 | ||
432 | /* now register seq file */ | 432 | /* now register seq file */ |
433 | err = seq_open(file, &tpm_ascii_b_measurments_seqops); | 433 | err = seq_open(file, &tpm_ascii_b_measurments_seqops); |
@@ -435,10 +435,15 @@ static int tpm_ascii_bios_measurements_open(struct inode *inode, | |||
435 | seq = file->private_data; | 435 | seq = file->private_data; |
436 | seq->private = log; | 436 | seq->private = log; |
437 | } else { | 437 | } else { |
438 | kfree(log->bios_event_log); | 438 | goto out_free; |
439 | kfree(log); | ||
440 | } | 439 | } |
440 | |||
441 | out: | ||
441 | return err; | 442 | return err; |
443 | out_free: | ||
444 | kfree(log->bios_event_log); | ||
445 | kfree(log); | ||
446 | goto out; | ||
442 | } | 447 | } |
443 | 448 | ||
444 | const struct file_operations tpm_ascii_bios_measurements_ops = { | 449 | const struct file_operations tpm_ascii_bios_measurements_ops = { |