Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32691
Change subject: util/ifdtool: Add find_fd null check ......................................................................
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 --- M util/ifdtool/ifdtool.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/32691/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index a97f352..6c5e784 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -236,7 +236,7 @@ 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);
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32691 )
Change subject: util/ifdtool: Add find_fd null check ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32691 )
Change subject: util/ifdtool: Add find_fd null check ......................................................................
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 --- M util/ifdtool/ifdtool.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Patrick Rudolph: Looks good to me, approved
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index a97f352..6c5e784 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -236,7 +236,7 @@ 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);