]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tpm: adjust return value of tpm_read_log
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tue, 22 Nov 2016 16:58:56 +0000 (09:58 -0700)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Sun, 27 Nov 2016 23:31:33 +0000 (01:31 +0200)
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm_eventlog.c

index c73f88cdeadf222cbf47ffc3e68fcc19cad8e09b..11bb1138a8282ebf73fb360c3ea873731d54dd35 100644 (file)
@@ -381,7 +381,8 @@ static int tpm_read_log(struct tpm_chip *chip)
  * If an event log is found then the securityfs files are setup to
  * export it to userspace, otherwise nothing is done.
  *
- * Returns -ENODEV if the firmware has no event log.
+ * Returns -ENODEV if the firmware has no event log or securityfs is not
+ * supported.
  */
 int tpm_bios_log_setup(struct tpm_chip *chip)
 {
@@ -432,9 +433,10 @@ int tpm_bios_log_setup(struct tpm_chip *chip)
        return 0;
 
 err:
+       rc = PTR_ERR(chip->bios_dir[cnt]);
        chip->bios_dir[cnt] = NULL;
        tpm_bios_log_teardown(chip);
-       return -EIO;
+       return rc;
 }
 
 void tpm_bios_log_teardown(struct tpm_chip *chip)