John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44777 )
Change subject: vendorcode/google: Add error handling ......................................................................
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 --- M src/vendorcode/google/chromeos/cse_board_reset.c 1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/44777/1
diff --git a/src/vendorcode/google/chromeos/cse_board_reset.c b/src/vendorcode/google/chromeos/cse_board_reset.c index 6034f0d..2e6ed9b 100644 --- a/src/vendorcode/google/chromeos/cse_board_reset.c +++ b/src/vendorcode/google/chromeos/cse_board_reset.c @@ -12,11 +12,20 @@
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, + "ERROR: tlcl_lib_init() failed for CR50 update: %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