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>
This commit is contained in:
parent
c53665ce55
commit
d3a73280cc
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue