Skip to content

Commit

Permalink
xapea00x: do not fail if the platform auth was already set
Browse files Browse the repository at this point in the history
A soft reboot of a computer does not power cycle the mini pci-e or USB
devices. Consequently, the TPM platform hierarchy auth will still be
set from the previous boot.  This condition should not be treated as
an error.
  • Loading branch information
drbild committed May 24, 2018
1 parent b31ea61 commit 42f4b3d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions xapea00x-tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#define TPM_RC_SUCCESS 0x000
#define TPM_RC_INITIALIZE 0x100

#define TPM_RC_BAD_AUTH 0x9A2

enum tis_access {
TPM_ACCESS_VALID = 0x80,
TPM_ACCESS_ACTIVE_LOCALITY = 0x20,
Expand Down Expand Up @@ -874,9 +876,13 @@ static int xapea00x_tpm_randomize_platform_auth(struct xapea00x_device *dev)
if (retval)
goto out;

if (rc != TPM_RC_SUCCESS) {
if (rc == TPM_RC_BAD_AUTH) {
dev_warn(&dev->interface->dev,
"Platform hierarchy auth was already set. Not changing\n");
} else if (rc != TPM_RC_SUCCESS) {
retval = -EIO;
pr_notice("HierarchyChangeAuth result code: %d\n", rc);
dev_err(&dev->interface->dev,
"HierarchyChangeAuth failed with %d\n", rc);
goto out;
}

Expand Down

0 comments on commit 42f4b3d

Please sign in to comment.