summaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos
diff options
context:
space:
mode:
authorJohn Zhao <john.zhao@intel.com>2020-08-25 10:21:01 -0700
committerPatrick Georgi <pgeorgi@google.com>2020-08-31 06:28:45 +0000
commitf90e3b9975f0bd9b09b29c50ac5f7bc36c02eeab (patch)
treeed0edd231924c4dcd58f1f6d1678c70247255c38 /src/vendorcode/google/chromeos
parent66b0c5e8847c818bb7e9ed9748bca729e962202a (diff)
vendorcode/google: Add error handling
Coverity detects missing error handling after calling function tlcl_lib_init. This change checks the function tlcl_lib_init return value and handles error properly. Found-by: Coverity CID 1431994 TEST=None Signed-off-by: John Zhao <john.zhao@intel.com> Change-Id: Ib831646b6a231ad57e3bfef85b801b592d572e6a Reviewed-on: https://review.coreboot.org/c/coreboot/+/44777 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Caveh Jalali <caveh@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/vendorcode/google/chromeos')
-rw-r--r--src/vendorcode/google/chromeos/cse_board_reset.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/cse_board_reset.c b/src/vendorcode/google/chromeos/cse_board_reset.c
index 6034f0d14c..65e09aeedb 100644
--- a/src/vendorcode/google/chromeos/cse_board_reset.c
+++ b/src/vendorcode/google/chromeos/cse_board_reset.c
@@ -9,14 +9,22 @@
#include <halt.h>
#include <intelblocks/cse.h>
#include <security/tpm/tss.h>
+#include <vb2_api.h>
void cse_board_reset(void)
{
+ int ret;
struct cr50_firmware_version version;
/* Initialize TPM and get the cr50 firmware version. */
- tlcl_lib_init();
+ ret = tlcl_lib_init();
+ if (ret != VB2_SUCCESS) {
+ printk(BIOS_ERR, "tlcl_lib_init() failed: 0x%x\n", ret);
+ return;
+ }
+
cr50_get_firmware_version(&version);
+
/*
* Cr50 firmware versions 0.[3|4].20 or newer support strap config 0xe where PLTRST from
* AP is connected to cr50's PLTRST# signal. So return immediately and trigger a