diff options
-rw-r--r-- | drivers/char/tpm/tpm_bios.c | 11 | ||||
-rw-r--r-- | kernel/ksysfs.c | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index 4b26ce48189b..8677fc6a545e 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, | |||
465 | return -ENOMEM; | 465 | return -ENOMEM; |
466 | 466 | ||
467 | if ((err = read_log(log))) | 467 | if ((err = read_log(log))) |
468 | return err; | 468 | goto out_free; |
469 | 469 | ||
470 | /* now register seq file */ | 470 | /* now register seq file */ |
471 | err = seq_open(file, &tpm_binary_b_measurments_seqops); | 471 | err = seq_open(file, &tpm_binary_b_measurments_seqops); |
@@ -473,10 +473,15 @@ static int tpm_binary_bios_measurements_open(struct inode *inode, | |||
473 | seq = file->private_data; | 473 | seq = file->private_data; |
474 | seq->private = log; | 474 | seq->private = log; |
475 | } else { | 475 | } else { |
476 | kfree(log->bios_event_log); | 476 | goto out_free; |
477 | kfree(log); | ||
478 | } | 477 | } |
478 | |||
479 | out: | ||
479 | return err; | 480 | return err; |
481 | out_free: | ||
482 | kfree(log->bios_event_log); | ||
483 | kfree(log); | ||
484 | goto out; | ||
480 | } | 485 | } |
481 | 486 | ||
482 | const struct file_operations tpm_binary_bios_measurements_ops = { | 487 | const struct file_operations tpm_binary_bios_measurements_ops = { |
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 2565e1b6dd7b..d0e5c48e18c7 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c | |||
@@ -65,8 +65,8 @@ KERNEL_ATTR_RO(kexec_crash_loaded); | |||
65 | /* | 65 | /* |
66 | * Make /sys/kernel/notes give the raw contents of our kernel .notes section. | 66 | * Make /sys/kernel/notes give the raw contents of our kernel .notes section. |
67 | */ | 67 | */ |
68 | extern const char __start_notes __attribute__((weak)); | 68 | extern const void __start_notes __attribute__((weak)); |
69 | extern const char __stop_notes __attribute__((weak)); | 69 | extern const void __stop_notes __attribute__((weak)); |
70 | #define notes_size (&__stop_notes - &__start_notes) | 70 | #define notes_size (&__stop_notes - &__start_notes) |
71 | 71 | ||
72 | static ssize_t notes_read(struct kobject *kobj, struct bin_attribute *bin_attr, | 72 | static ssize_t notes_read(struct kobject *kobj, struct bin_attribute *bin_attr, |