Skip to content

Commit

Permalink
tpm: adjust return value of tpm_read_log
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
jgunthorpe authored and Jarkko Sakkinen committed Nov 27, 2016
1 parent c4484f7 commit 9430066
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/char/tpm/tpm_eventlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9430066

Please sign in to comment.