From d39f2ab3efec9794fcc9e83531ee1bdfb18d9d43 Mon Sep 17 00:00:00 2001 From: Rizwan Qureshi Date: Fri, 16 Sep 2016 19:45:08 +0530 Subject: [PATCH] UPSTREAM: kunimitsu: Remove incorrect dereferencing of pointer In spd_util.c function mainboard_get_spd_data(), spd_file can either be NULL or will point to the first byte of the SPD data, and should not be dereferenced. BUG=None BRANCH=None TEST=None Change-Id: I1b18aea7772e4c589345d40ab02d2e871d3d067f Signed-off-by: Rizwan Qureshi Reviewed-on: https://review.coreboot.org/16612 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/388111 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh --- src/mainboard/intel/kunimitsu/spd/spd_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mainboard/intel/kunimitsu/spd/spd_util.c b/src/mainboard/intel/kunimitsu/spd/spd_util.c index 0ce2acf6ff..a17b519919 100644 --- a/src/mainboard/intel/kunimitsu/spd/spd_util.c +++ b/src/mainboard/intel/kunimitsu/spd/spd_util.c @@ -85,7 +85,7 @@ uintptr_t mainboard_get_spd_data(void) /* Load SPD data from CBFS */ spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD, &spd_file_len); - if (!(*spd_file)) + if (!spd_file) die("SPD data not found."); /* make sure we have at least one SPD in the file. */