mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: 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 BUG=None BRANCH=None TEST=None 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> Change-Id: I92995366ffb15afd0950b9a8bbb6fe16252b2c38 Reviewed-on: https://chromium-review.googlesource.com/415045 Commit-Ready: Aaron Durbin <adurbin@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
30d88884c5
commit
9c6abbaad6
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue