Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45411 )
Change subject: soc/intel/common/block: Fix Klocwork issue ......................................................................
soc/intel/common/block: Fix Klocwork issue
List of changes: 1. Add NULL check for pointer ctx 2. Initialize pointer soc_config with NULL
Signed-off-by: Subrata Banik subrata.banik@intel.com Change-Id: I16015b538112e0b125b4a5e145c26263c456953c --- M src/soc/intel/common/block/chip/chip.c M src/soc/intel/common/block/cse/cse_lite.c 2 files changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/45411/1
diff --git a/src/soc/intel/common/block/chip/chip.c b/src/soc/intel/common/block/chip/chip.c index 09f2c47..47bee7c 100644 --- a/src/soc/intel/common/block/chip/chip.c +++ b/src/soc/intel/common/block/chip/chip.c @@ -5,7 +5,7 @@
const struct soc_intel_common_config *chip_get_common_soc_structure(void) { - const struct soc_intel_common_config *soc_config; + const struct soc_intel_common_config *soc_config = NULL; const config_t *config;
config = config_of_soc(); diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index edb08da..17e8ef6 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -169,8 +169,9 @@ /* Log CSE Firmware Status Registers to help debugging */ cse_log_status_registers(); if (CONFIG(VBOOT)) { - struct vb2_context *ctx; - ctx = vboot_get_context(); + struct vb2_context *ctx = vboot_get_context(); + if (ctx == NULL) + return; vb2api_fail(ctx, VB2_RECOVERY_INTEL_CSE_LITE_SKU, rec_sub_code); vboot_save_data(ctx); vboot_reboot();