summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Zhao <john.zhao@intel.com>2019-05-31 09:58:49 -0700
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2019-06-05 13:02:32 +0000
commitd3a73280cc8e01a28cbdb1a4d086e4dda7b35f0c (patch)
treed829ab7951dc30703124594f162f24640d9a8d09
parentc53665ce55ba4f5a670caf382213d984a2991900 (diff)
src/drivers/intel: Avoid NULL pointer dereference
Coverity detects pointer fih as FORWARD_NULL. Add sanity check for fih to prevent NULL pointer dereference. BUG=CID 1401717 TEST=Built and boot up to kernel. Change-Id: Ia6853e5302c87d9ffe52b942f067be56f6e77406 Signed-off-by: John Zhao <john.zhao@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33150 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Christian Walter <christian.walter@9elements.com>
-rw-r--r--src/drivers/intel/fsp1_1/car.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c
index 10f9524650..dd17664036 100644
--- a/src/drivers/intel/fsp1_1/car.c
+++ b/src/drivers/intel/fsp1_1/car.c
@@ -120,6 +120,9 @@ void mainboard_romstage_entry(unsigned long bist)
* the flash is memory mapped CPU's address space. */
FSP_INFO_HEADER *fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp)));
+ if (!fih)
+ die("Invalid FSP header\n");
+
cache_as_ram_stage_main(fih);
}