summaryrefslogtreecommitdiff
path: root/src/northbridge/intel/haswell
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2017-06-20 14:49:04 +0200
committerMartin Roth <martinroth@google.com>2017-06-22 15:20:23 +0000
commitacac02d5d27c74c690353f8a62a3e3cad8947b56 (patch)
treebc4aae5fcdf7a420546165949784074096eb337a /src/northbridge/intel/haswell
parentaa9643e850f1af1f3762ad9fc892d2d1f09b3ca0 (diff)
nb/intel/haswell/raminit: Die if cbmem_add() fails
Maybe we could go on, but cbmem_add() failing is a very bad sign. Should fix coverity CID 1376384 (Null pointer dereferences (NULL_RETURNS)). Change-Id: I330cee6db3540c6a9c408d56da43105de5d075f7 Found-by: Coverity Scan #1376384 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/20280 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'src/northbridge/intel/haswell')
-rw-r--r--src/northbridge/intel/haswell/raminit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/northbridge/intel/haswell/raminit.c b/src/northbridge/intel/haswell/raminit.c
index 50443aa94c..aa07f16625 100644
--- a/src/northbridge/intel/haswell/raminit.c
+++ b/src/northbridge/intel/haswell/raminit.c
@@ -187,6 +187,8 @@ void setup_sdram_meminfo(struct pei_data *pei_data)
int dimm_cnt = 0;
mem_info = cbmem_add(CBMEM_ID_MEMINFO, sizeof(struct memory_info));
+ if (!mem_info)
+ die("Failed to add memory info to CBMEM.\n");
memset(mem_info, 0, sizeof(struct memory_info));
addr_decoder_common = MCHBAR32(0x5000);