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
Hello build bot (Jenkins), Caveh Jalali, Tim Wawrzynczak,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44777
to look at the new patch set (#2).
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, 9 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/44777/2
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44777 )
Change subject: vendorcode/google: Add error handling ......................................................................
Patch Set 2: Code-Review+2
Thanks John!
Caveh Jalali has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44777 )
Change subject: vendorcode/google: Add error handling ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44777/2/src/vendorcode/google/chrom... File src/vendorcode/google/chromeos/cse_board_reset.c:
https://review.coreboot.org/c/coreboot/+/44777/2/src/vendorcode/google/chrom... PS2, Line 22: %x 0x%x
Hello build bot (Jenkins), Caveh Jalali, Tim Wawrzynczak,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44777
to look at the new patch set (#3).
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, 9 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/44777/3
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44777 )
Change subject: vendorcode/google: Add error handling ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44777/2/src/vendorcode/google/chrom... File src/vendorcode/google/chromeos/cse_board_reset.c:
https://review.coreboot.org/c/coreboot/+/44777/2/src/vendorcode/google/chrom... PS2, Line 22: %x
0x%x
Done
Caveh Jalali has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44777 )
Change subject: vendorcode/google: Add error handling ......................................................................
Patch Set 3: Code-Review+2
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44777 )
Change subject: vendorcode/google: Add error handling ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change. ( 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 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 --- M src/vendorcode/google/chromeos/cse_board_reset.c 1 file changed, 9 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Caveh Jalali: Looks good to me, approved Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/vendorcode/google/chromeos/cse_board_reset.c b/src/vendorcode/google/chromeos/cse_board_reset.c index 6034f0d..65e09ae 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