Philipp Deppenwiese has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33150 )
Change subject: src/drivers/intel: Avoid NULL pointer dereference ......................................................................
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 --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, approved Christian Walter: Looks good to me, but someone else must approve
diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c index 10f9524..dd1766403 100644 --- a/src/drivers/intel/fsp1_1/car.c +++ b/src/drivers/intel/fsp1_1/car.c @@ -120,6 +120,9 @@ * 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); }