summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2016-11-18 12:02:18 -0700
committerMartin Roth <martinroth@google.com>2016-11-21 23:45:06 +0100
commit53bd26f531d9ee920948a931a03aae23de21f0ce (patch)
tree6df80e54744354825d04f9b478b59d64c54eef87 /src
parentad6c885ce48edeb0120499c0877e3145080a901e (diff)
downloadcoreboot-53bd26f531d9ee920948a931a03aae23de21f0ce.tar.xz
drivers/intel/fsp2_0: Check for NULL before using pointer
The cbmem routines pass back NULL on error. Check for this before using the pointer. Addresses coverity issue 1365731 - Dereference null return value Change-Id: I92995366ffb15afd0950b9a8bbb6fe16252b2c38 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/17480 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/intel/fsp2_0/hand_off_block.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c
index a8b9878d9f..4a8e73a83c 100644
--- a/src/drivers/intel/fsp2_0/hand_off_block.c
+++ b/src/drivers/intel/fsp2_0/hand_off_block.c
@@ -106,6 +106,8 @@ static void save_hob_list(int is_recovery)
{
uint32_t *cbmem_loc;
cbmem_loc = cbmem_add(CBMEM_ID_FSP_RUNTIME, sizeof(*cbmem_loc));
+ if (cbmem_loc == NULL)
+ die("Error: Could not add cbmem area for hob list.\n");
*cbmem_loc = (uintptr_t)fsp_get_hob_list();
}