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>
This commit is contained in:
Jacob Garber 2019-05-08 13:40:45 -06:00 committed by Patrick Georgi
parent e091d0efc4
commit 9bb0461fbd
1 changed files with 1 additions and 1 deletions

View File

@ -236,7 +236,7 @@ static int get_ifd_version_from_fcba(char *image, int size)
int read_freq; int read_freq;
const fcba_t *fcba = find_fcba(image, size); const fcba_t *fcba = find_fcba(image, size);
const fdbar_t *fdb = find_fd(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); exit(EXIT_FAILURE);
chipset = guess_ich_chipset(fdb); chipset = guess_ich_chipset(fdb);