summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorWerner Zeh <werner.zeh@siemens.com>2017-07-13 13:21:33 +0200
committerMartin Roth <martinroth@google.com>2017-07-17 03:18:03 +0000
commit52793444be5fb7b63ebfbe31f1b513c833e08dd0 (patch)
tree395cbbd526d6f1dfbdb4c5ff3f332e163113e4ab /src/drivers
parent0e660873bf2466bd8a1f73332b58253f231c2f85 (diff)
downloadcoreboot-52793444be5fb7b63ebfbe31f1b513c833e08dd0.tar.xz
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>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/intel/fsp1_1/bootblock.c5
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");