From 2a20d13c3935f826a71c635d07dd142bfd84d9dd Mon Sep 17 00:00:00 2001 From: Joel Kitching Date: Thu, 8 Aug 2019 14:20:26 +0800 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/34790 Reviewed-by: Subrata Banik Reviewed-by: Aamir Bohra Reviewed-by: Ronak Kanabar Reviewed-by: V Sowmya Reviewed-by: caveh jalali Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/security/vboot/vboot_logic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index c61d6bec33..7f00df5796 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -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);