tpm2/tlcl_send_startup: correct TPM2_Startup error logic

BUG=b:114018226
TEST=compile coreboot

Change-Id: Iffad582d5c19252dde1c9dc97fc7fd145944a3b3
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://review.coreboot.org/28749
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Joel Kitching 2018-09-26 17:52:54 +08:00 committed by Philipp Deppenwiese
parent 7aa44522f2
commit f97ff0cd50

View file

@ -61,14 +61,13 @@ static uint32_t tlcl_send_startup(TPM_SU type)
startup.startup_type = type;
response = tpm_process_command(TPM2_Startup, &startup);
if (response && response->hdr.tpm_code &&
(response->hdr.tpm_code != TPM_RC_INITIALIZE)) {
printk(BIOS_INFO, "%s: Startup return code is %x\n",
__func__, response->hdr.tpm_code);
return TPM_E_IOERROR;
if (response && (response->hdr.tpm_code == 0 ||
response->hdr.tpm_code == TPM_RC_INITIALIZE)) {
return TPM_SUCCESS;
}
return TPM_SUCCESS;
printk(BIOS_INFO, "%s: Startup return code is %x\n",
__func__, response->hdr.tpm_code);
return TPM_E_IOERROR;
}
uint32_t tlcl_resume(void)