Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33049
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
drivers/intel/fsp1_1: Exit cleanly if FSP not found
Instead of dereferencing a null pointer, print a nice message and exit cleanly if the FSP isn't found in the CBFS.
Change-Id: I761e7febc7cec5bd2ef3af214bc51777ee5c313d Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1401467 --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 6 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/33049/1
diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c index 34b2518..194406b 100644 --- a/src/drivers/intel/fsp1_1/car.c +++ b/src/drivers/intel/fsp1_1/car.c @@ -159,19 +159,16 @@ { /* Need to locate the current FSP_INFO_HEADER. The cache-as-ram * is still enabled. We can directly access work buffer here. */ - FSP_INFO_HEADER *fih; struct prog fsp = PROG_INIT(PROG_REFCODE, "fsp.bin");
console_init();
- if (prog_locate(&fsp)) { - fih = NULL; - printk(BIOS_ERR, "Unable to locate %s\n", prog_name(&fsp)); - } else { - /* This leaks a mapping which this code assumes is benign as - * the flash is memory mapped CPU's address space. */ - fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp))); - } + if (prog_locate(&fsp)) + die_with_post_code(POST_INVALID_CBFS, "Unable to locate fsp.bin"); + + /* This leaks a mapping which this code assumes is benign as + * the flash is memory mapped CPU's address space. */ + FSP_INFO_HEADER *fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp)));
cache_as_ram_stage_main(fih);
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33049 )
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/#/c/33049/1/src/drivers/intel/fsp1_1/car.c File src/drivers/intel/fsp1_1/car.c:
https://review.coreboot.org/#/c/33049/1/src/drivers/intel/fsp1_1/car.c@167 PS1, Line 167: die_with_post_code(POST_INVALID_CBFS, "Unable to locate fsp.bin"); line over 80 characters
https://review.coreboot.org/#/c/33049/1/src/drivers/intel/fsp1_1/car.c@171 PS1, Line 171: FSP_INFO_HEADER *fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp))); line over 80 characters
Lance Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33049 )
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
Patch Set 1: Code-Review+1
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33049 )
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
Patch Set 1: Code-Review+2
Hello David Hendricks, Lance Zhao, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/33049
to look at the new patch set (#2).
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
drivers/intel/fsp1_1: Exit cleanly if FSP not found
Instead of dereferencing a null pointer, print a nice message and exit cleanly if the FSP isn't found in the CBFS.
Change-Id: I761e7febc7cec5bd2ef3af214bc51777ee5c313d Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1401467 --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 6 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/33049/2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33049 )
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/#/c/33049/2/src/drivers/intel/fsp1_1/car.c File src/drivers/intel/fsp1_1/car.c:
https://review.coreboot.org/#/c/33049/2/src/drivers/intel/fsp1_1/car.c@166 PS2, Line 166: die_with_post_code(POST_INVALID_CBFS, "Unable to locate fsp.bin"); line over 80 characters
https://review.coreboot.org/#/c/33049/2/src/drivers/intel/fsp1_1/car.c@170 PS2, Line 170: FSP_INFO_HEADER *fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp))); line over 80 characters
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33049 )
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/#/c/33049/3/src/drivers/intel/fsp1_1/car.c File src/drivers/intel/fsp1_1/car.c:
https://review.coreboot.org/#/c/33049/3/src/drivers/intel/fsp1_1/car.c@166 PS3, Line 166: die_with_post_code(POST_INVALID_CBFS, "Unable to locate fsp.bin"); line over 80 characters
https://review.coreboot.org/#/c/33049/3/src/drivers/intel/fsp1_1/car.c@170 PS3, Line 170: FSP_INFO_HEADER *fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp))); line over 80 characters
Hello Arthur Heymans, David Hendricks, Lance Zhao, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/33049
to look at the new patch set (#4).
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
drivers/intel/fsp1_1: Exit cleanly if FSP not found
Instead of dereferencing a null pointer, print a nice message and exit cleanly if the FSP isn't found in the CBFS.
Change-Id: I761e7febc7cec5bd2ef3af214bc51777ee5c313d Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1401467, 1401717 --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 6 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/33049/4
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33049 )
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
Patch Set 4: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33049 )
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found ......................................................................
drivers/intel/fsp1_1: Exit cleanly if FSP not found
Instead of dereferencing a null pointer, print a nice message and exit cleanly if the FSP isn't found in the CBFS.
Change-Id: I761e7febc7cec5bd2ef3af214bc51777ee5c313d Signed-off-by: Jacob Garber jgarber1@ualberta.ca Found-by: Coverity CID 1401467, 1401717 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33049 Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/intel/fsp1_1/car.c 1 file changed, 6 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c index 82dc320..41a02f3 100644 --- a/src/drivers/intel/fsp1_1/car.c +++ b/src/drivers/intel/fsp1_1/car.c @@ -160,17 +160,14 @@ { /* Need to locate the current FSP_INFO_HEADER. The cache-as-ram * is still enabled. We can directly access work buffer here. */ - FSP_INFO_HEADER *fih; struct prog fsp = PROG_INIT(PROG_REFCODE, "fsp.bin");
- if (prog_locate(&fsp)) { - fih = NULL; - printk(BIOS_ERR, "Unable to locate %s\n", prog_name(&fsp)); - } else { - /* This leaks a mapping which this code assumes is benign as - * the flash is memory mapped CPU's address space. */ - fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp))); - } + if (prog_locate(&fsp)) + die_with_post_code(POST_INVALID_CBFS, "Unable to locate fsp.bin"); + + /* This leaks a mapping which this code assumes is benign as + * the flash is memory mapped CPU's address space. */ + FSP_INFO_HEADER *fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp)));
cache_as_ram_stage_main(fih); }