John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33150
Change subject: src/drivers/intel: Fix Coverity scan report ......................................................................
src/drivers/intel: Fix Coverity scan report
Coverity detects pointer fih as FORWARD_NULL. Add sanity check for fih to prevent null pointer dereference.
BUG=CID 1401717 TEST=Built and boot up to kernel.
Change-Id: Ia6853e5302c87d9ffe52b942f067be56f6e77406 Signed-off-by: John Zhao john.zhao@intel.com --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/33150/1
diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c index 3a41e40..17e6328 100644 --- a/src/drivers/intel/fsp1_1/car.c +++ b/src/drivers/intel/fsp1_1/car.c @@ -112,6 +112,9 @@ * the flash is memory mapped CPU's address space. */ fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp)));
+ if (!fih) + return; + set_fih_car(fih);
/* Return new stack value in RAM back to assembly stub. */
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/33150
to look at the new patch set (#2).
Change subject: src/drivers/intel: Fix Coverity scan report ......................................................................
src/drivers/intel: Fix Coverity scan report
Coverity detects pointer fih as FORWARD_NULL. Add sanity check for fih to prevent null pointer dereference.
BUG=CID 1401717 TEST=Built and boot up to kernel.
Change-Id: Ia6853e5302c87d9ffe52b942f067be56f6e77406 Signed-off-by: John Zhao john.zhao@intel.com --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/33150/2
Jacob Garber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33150 )
Change subject: src/drivers/intel: Fix Coverity scan report ......................................................................
Patch Set 2:
See also https://review.coreboot.org/c/coreboot/+/33049
Hello Balaji Manigandan, Lijian Zhao, build bot (Jenkins), Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/33150
to look at the new patch set (#3).
Change subject: src/drivers/intel: Avoid NULL pointer dereference ......................................................................
src/drivers/intel: Avoid NULL pointer dereference
Coverity detects pointer fih as FORWARD_NULL. Add sanity check for fih to prevent NULL pointer dereference.
BUG=CID 1401717 TEST=Built and boot up to kernel.
Change-Id: Ia6853e5302c87d9ffe52b942f067be56f6e77406 Signed-off-by: John Zhao john.zhao@intel.com --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/33150/3
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33150 )
Change subject: src/drivers/intel: Avoid NULL pointer dereference ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/#/c/33150/3/src/drivers/intel/fsp1_1/car.c File src/drivers/intel/fsp1_1/car.c:
https://review.coreboot.org/#/c/33150/3/src/drivers/intel/fsp1_1/car.c@176 PS3, Line 176: return; return or rather die()? if the fsp isn't included, it won't get very far anyway
Hello Balaji Manigandan, build bot (Jenkins), Lijian Zhao, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/33150
to look at the new patch set (#4).
Change subject: src/drivers/intel: Avoid NULL pointer dereference ......................................................................
src/drivers/intel: Avoid NULL pointer dereference
Coverity detects pointer fih as FORWARD_NULL. Add sanity check for fih to prevent NULL pointer dereference.
BUG=CID 1401717 TEST=Built and boot up to kernel.
Change-Id: Ia6853e5302c87d9ffe52b942f067be56f6e77406 Signed-off-by: John Zhao john.zhao@intel.com --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/33150/4
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33150 )
Change subject: src/drivers/intel: Avoid NULL pointer dereference ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/33150/3/src/drivers/intel/fsp1_1/car.c File src/drivers/intel/fsp1_1/car.c:
https://review.coreboot.org/#/c/33150/3/src/drivers/intel/fsp1_1/car.c@176 PS3, Line 176: return;
return or rather die()? if the fsp isn't included, it won't get very far anyway
Updated with die() instead of return.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33150 )
Change subject: src/drivers/intel: Avoid NULL pointer dereference ......................................................................
Patch Set 4: Code-Review+2
Christian Walter has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33150 )
Change subject: src/drivers/intel: Avoid NULL pointer dereference ......................................................................
Patch Set 4: Code-Review+1
Philipp Deppenwiese has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33150 )
Change subject: src/drivers/intel: Avoid NULL pointer dereference ......................................................................
src/drivers/intel: Avoid NULL pointer dereference
Coverity detects pointer fih as FORWARD_NULL. Add sanity check for fih to prevent NULL pointer dereference.
BUG=CID 1401717 TEST=Built and boot up to kernel.
Change-Id: Ia6853e5302c87d9ffe52b942f067be56f6e77406 Signed-off-by: John Zhao john.zhao@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/33150 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Felix Held felix-coreboot@felixheld.de Reviewed-by: Christian Walter christian.walter@9elements.com --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, approved Christian Walter: Looks good to me, but someone else must approve
diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c index 10f9524..dd1766403 100644 --- a/src/drivers/intel/fsp1_1/car.c +++ b/src/drivers/intel/fsp1_1/car.c @@ -120,6 +120,9 @@ * the flash is memory mapped CPU's address space. */ FSP_INFO_HEADER *fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp)));
+ if (!fih) + die("Invalid FSP header\n"); + cache_as_ram_stage_main(fih); }