vboot: fix conditional using vboot_setup_tpm return value

vboot_setup_tpm returns (TPM_SUCCESS == 0) on success.
In this case, call antirollback_read_space_firmware.

This regression was introduced in CB:34510.

BUG=b:139101213
TEST=make clean && make test-abuild
BRANCH=none

Change-Id: Ifdea1d85167a50a1ada5afe9b107408e3a2e0d6f
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34790
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-by: Aamir Bohra <aamir.bohra@intel.com>
Reviewed-by: Ronak Kanabar <ronak.kanabar@intel.com>
Reviewed-by: V Sowmya <v.sowmya@intel.com>
Reviewed-by: caveh jalali <caveh@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Joel Kitching 2019-08-08 14:20:26 +08:00 committed by Subrata Banik
parent 2524928f5d
commit 2a20d13c39
1 changed files with 1 additions and 2 deletions

View File

@ -335,8 +335,7 @@ void verstage_main(void)
* check the return value here because vb2api_fw_phase1 will catch
* invalid secdata and tell us what to do (=reboot). */
timestamp_add_now(TS_START_TPMINIT);
rv = vboot_setup_tpm(&ctx);
if (rv)
if (vboot_setup_tpm(&ctx) == TPM_SUCCESS)
antirollback_read_space_firmware(&ctx);
timestamp_add_now(TS_END_TPMINIT);