[coreboot-gerrit] Change in coreboot[master]: tpm/tpm_setup: fail on invalid result from tlcl_resume

Joel Kitching (Code Review) gerrit at coreboot.org
Wed Sep 26 12:09:25 CEST 2018


Joel Kitching has uploaded this change for review. ( https://review.coreboot.org/28748


Change subject: tpm/tpm_setup: fail on invalid result from tlcl_resume
......................................................................

tpm/tpm_setup: fail on invalid result from tlcl_resume

BUG=b:114018226
TEST=None

Change-Id: I8f5df2b0119d35e4000fe62bf1bba6ca07f925f3
Signed-off-by: Joel Kitching <kitching at google.com>
---
M src/security/tpm/tspi/tspi.c
1 file changed, 17 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/48/28748/1

diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c
index 950e930..7782943 100644
--- a/src/security/tpm/tspi/tspi.c
+++ b/src/security/tpm/tspi/tspi.c
@@ -100,10 +100,24 @@
 	/* Handle special init for S3 resume path */
 	if (s3flag) {
 		result = tlcl_resume();
-		if (result == TPM_E_INVALID_POSTINIT)
-			printk(BIOS_INFO, "TPM: Already initialized.\n");
+		switch (result) {
+		case TPM_SUCCESS:
+			break;
 
-		return TPM_SUCCESS;
+		case TPM_E_INVALID_POSTINIT:
+			/*
+			 * We're on a platform where the TPM maintains power
+			 * in S3, so it's already initialized.
+			 */
+			printk(BIOS_INFO, "TPM: Already initialized.\n");
+			result = TPM_SUCCESS;
+			break;
+
+		default:
+			printk(BIOS_ERR, "TPM: Resume failed.\n");
+			break;
+
+		goto out;
 	}
 
 	result = tlcl_startup();

-- 
To view, visit https://review.coreboot.org/28748
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f5df2b0119d35e4000fe62bf1bba6ca07f925f3
Gerrit-Change-Number: 28748
Gerrit-PatchSet: 1
Gerrit-Owner: Joel Kitching <kitching at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180926/5328dba1/attachment.html>


More information about the coreboot-gerrit mailing list