From 6522bf1a81735d8f0fa6f4b8f5285e0b7e60be01 Mon Sep 17 00:00:00 2001 From: Ravi Sarawadi Date: Thu, 30 Nov 2017 11:25:40 -0800 Subject: [PATCH] soc/intel/apollolake/meminit_util_glk.c: Check for NULL We check for NULL here for memory_info_hob and return if it's NULL so that the future dereferencing is proper. Change-Id: Ie34931504ad92739fdaa68ec7989e76e8eee2595 Found-by: Klockworks Signed-off-by: Ravi Sarawadi Reviewed-on: https://review.coreboot.org/23223 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Furquan Shaikh --- src/soc/intel/apollolake/meminit_util_glk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/soc/intel/apollolake/meminit_util_glk.c b/src/soc/intel/apollolake/meminit_util_glk.c index 2ef2e49bfe..20e7cd29ed 100644 --- a/src/soc/intel/apollolake/meminit_util_glk.c +++ b/src/soc/intel/apollolake/meminit_util_glk.c @@ -39,6 +39,10 @@ void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku) } memory_info_hob = fsp_find_smbios_memory_info(&hob_size); + if (memory_info_hob == NULL) { + printk(BIOS_ERR, "SMBIOS memory info HOB is missing\n"); + return; + } /* * Allocate CBMEM area for DIMM information used to populate SMBIOS