diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2017-07-13 13:21:33 +0200 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-07-17 03:18:03 +0000 |
commit | 52793444be5fb7b63ebfbe31f1b513c833e08dd0 (patch) | |
tree | 395cbbd526d6f1dfbdb4c5ff3f332e163113e4ab | |
parent | 0e660873bf2466bd8a1f73332b58253f231c2f85 (diff) |
drivers/intel/fsp1_1: Handle errors in find_fsp()
The function find_fsp() parses the FSP header and returns either a valid
pointer to the FSP_INFO_HEADER or an error code. The caller of
find_fsp() only takes care about a NULL-pointer but not about a possible
error code. This leads to memory access violations in case of error when
FspTempRamInit is called.
To avoid this and to let the user know that there was an error while
parsing the FSP header show an error message and the error code.
Change-Id: I67fef0a53fb04c8ba5d18b5d4ef2fdc1aeba869e
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/20560
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r-- | src/drivers/intel/fsp1_1/bootblock.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/intel/fsp1_1/bootblock.c b/src/drivers/intel/fsp1_1/bootblock.c index c0f26d9a72..cf9e134719 100644 --- a/src/drivers/intel/fsp1_1/bootblock.c +++ b/src/drivers/intel/fsp1_1/bootblock.c @@ -35,6 +35,11 @@ void bootblock_fsp_temp_ram_init(void) /* Locate the FSP header */ fih = find_fsp(CONFIG_FSP_LOC); /* Check the FSP header */ + if (((uintptr_t)fih >= ERROR_NO_FV_SIG) && + ((uintptr_t)fih <= ERROR_FSP_REV_MISMATCH)) { + printk(BIOS_ERR, "FSP header error %p, ", fih); + fih = NULL; + } if (fih == NULL) die("FSP_INFO_HEADER not set!\n"); |