aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2016-11-22 11:58:56 -0500
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-11-27 18:31:33 -0500
commit9430066a15d6f55a3d008a6f99bb462480870207 (patch)
tree8273208d9d761d8fea7ce8af0bb6207546d30c58
parentc4484f791c9434445db7fc1d6791af4388756479 (diff)
tpm: adjust return value of tpm_read_log
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>
-rw-r--r--drivers/char/tpm/tpm_eventlog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c
index c73f88cdeadf..11bb1138a828 100644
--- a/drivers/char/tpm/tpm_eventlog.c
+++ b/drivers/char/tpm/tpm_eventlog.c
@@ -381,7 +381,8 @@ static int tpm_read_log(struct tpm_chip *chip)
381 * If an event log is found then the securityfs files are setup to 381 * If an event log is found then the securityfs files are setup to
382 * export it to userspace, otherwise nothing is done. 382 * export it to userspace, otherwise nothing is done.
383 * 383 *
384 * Returns -ENODEV if the firmware has no event log. 384 * Returns -ENODEV if the firmware has no event log or securityfs is not
385 * supported.
385 */ 386 */
386int tpm_bios_log_setup(struct tpm_chip *chip) 387int tpm_bios_log_setup(struct tpm_chip *chip)
387{ 388{
@@ -432,9 +433,10 @@ int tpm_bios_log_setup(struct tpm_chip *chip)
432 return 0; 433 return 0;
433 434
434err: 435err:
436 rc = PTR_ERR(chip->bios_dir[cnt]);
435 chip->bios_dir[cnt] = NULL; 437 chip->bios_dir[cnt] = NULL;
436 tpm_bios_log_teardown(chip); 438 tpm_bios_log_teardown(chip);
437 return -EIO; 439 return rc;
438} 440}
439 441
440void tpm_bios_log_teardown(struct tpm_chip *chip) 442void tpm_bios_log_teardown(struct tpm_chip *chip)