summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-05-08 13:40:45 -0600
committerPatrick Georgi <pgeorgi@google.com>2019-05-13 09:12:14 +0000
commit9bb0461fbd8cdcceabde0ec266a5207bc40ea9a7 (patch)
tree5fb45fa05dae6a36a0f6b1a56d9bafd178f620b2
parente091d0efc40581ce789fdef5f44a327b75adc999 (diff)
downloadcoreboot-9bb0461fbd8cdcceabde0ec266a5207bc40ea9a7.tar.xz
util/ifdtool: Add find_fd null check
As the previous comment indicated, this null check is currently superfluous, but adding it in makes Coverity happy, and future-proofs the code in case someone changes the internals of 'find_fcba' later and forgets/doesn't know to update this error check. Found-by: Coverity Scan #1395066 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Change-Id: I594cd0098f5b36cef5b3efc4c904710d3ba9b815 Reviewed-on: https://review.coreboot.org/c/coreboot/+/32691 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
-rw-r--r--util/ifdtool/ifdtool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
index a97f352bdf..6c5e784569 100644
--- a/util/ifdtool/ifdtool.c
+++ b/util/ifdtool/ifdtool.c
@@ -236,7 +236,7 @@ static int get_ifd_version_from_fcba(char *image, int size)
int read_freq;
const fcba_t *fcba = find_fcba(image, size);
const fdbar_t *fdb = find_fd(image, size);
- if (!fcba) /* a valid fcba indicates a valid fdb */
+ if (!fcba || !fdb)
exit(EXIT_FAILURE);
chipset = guess_ich_chipset(fdb);