From 9430066a15d6f55a3d008a6f99bb462480870207 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Tue, 22 Nov 2016 09:58:56 -0700 Subject: [PATCH] tpm: adjust return value of tpm_read_log Signed-off-by: Jason Gunthorpe Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_eventlog.c | 6 ++++-- 1 file 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) * 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)