From 60296aec76e29acd62b999b2cd72bcea1592f1ed Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Sun, 6 Sep 2020 18:50:14 +0530 Subject: util/ifdtool: Add NULL check for pointer fpsba This patch adds NULL check inside get_ifd_version_from_fcba() function to fix Klocwork issue. BUG=b:153888802 Signed-off-by: Subrata Banik Change-Id: I525054376b36c658b93760b185ef6dd170f5aea9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45130 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph --- util/ifdtool/ifdtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index e2fd0abd1b..fab034ade4 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -265,7 +265,7 @@ static int get_ifd_version_from_fcba(char *image, int size) const fcba_t *fcba = find_fcba(image, size); const fdbar_t *fdb = find_fd(image, size); const fpsba_t *fpsba = find_fpsba(image, size); - if (!fcba || !fdb) + if (!fcba || !fdb || !fpsba) exit(EXIT_FAILURE); chipset = guess_ich_chipset(fdb, fpsba); -- cgit v1.2.3