John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45620 )
Change subject: drivers/spi: Check return value for error handling ......................................................................
drivers/spi: Check return value for error handling
Coverity detects calling function spi_sdcard_do_command without checking return value. Fix this issue by chekcing return value for error handling.
Found-by: Coverity CID 1407737 TEST=None
Signed-off-by: John Zhao john.zhao@intel.com Change-Id: Ie0d28806b5c0b4c6d509e583d115358864eeff80 --- M src/drivers/spi/spi_sdcard.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/45620/1
diff --git a/src/drivers/spi/spi_sdcard.c b/src/drivers/spi/spi_sdcard.c index 4eb033e..a670111 100644 --- a/src/drivers/spi/spi_sdcard.c +++ b/src/drivers/spi/spi_sdcard.c @@ -354,7 +354,9 @@ uint32_t *out_register) { /* CMD55 */ - spi_sdcard_do_command(card, APP_CMD, 0, NULL); + if (spi_sdcard_do_command(card, APP_CMD, 0, NULL)) + return -1; + return spi_sdcard_do_command_help(card, 1, cmd, argument, out_register); }
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45620 )
Change subject: drivers/spi: Check return value for error handling ......................................................................
Patch Set 1: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/45620/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/45620/1//COMMIT_MSG@10 PS1, Line 10: chekcing checking
Hello build bot (Jenkins), Tim Wawrzynczak, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45620
to look at the new patch set (#2).
Change subject: drivers/spi: Check return value for error handling ......................................................................
drivers/spi: Check return value for error handling
Coverity detects calling function spi_sdcard_do_command without checking return value. Fix this issue by checking return value for error handling.
Found-by: Coverity CID 1407737 TEST=None
Signed-off-by: John Zhao john.zhao@intel.com Change-Id: Ie0d28806b5c0b4c6d509e583d115358864eeff80 --- M src/drivers/spi/spi_sdcard.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/45620/2
John Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45620 )
Change subject: drivers/spi: Check return value for error handling ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45620/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/45620/1//COMMIT_MSG@10 PS1, Line 10: chekcing
checking
Ack
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/45620 )
Change subject: drivers/spi: Check return value for error handling ......................................................................
drivers/spi: Check return value for error handling
Coverity detects calling function spi_sdcard_do_command without checking return value. Fix this issue by checking return value for error handling.
Found-by: Coverity CID 1407737 TEST=None
Signed-off-by: John Zhao john.zhao@intel.com Change-Id: Ie0d28806b5c0b4c6d509e583d115358864eeff80 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45620 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/drivers/spi/spi_sdcard.c 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/drivers/spi/spi_sdcard.c b/src/drivers/spi/spi_sdcard.c index 4eb033e..a670111 100644 --- a/src/drivers/spi/spi_sdcard.c +++ b/src/drivers/spi/spi_sdcard.c @@ -354,7 +354,9 @@ uint32_t *out_register) { /* CMD55 */ - spi_sdcard_do_command(card, APP_CMD, 0, NULL); + if (spi_sdcard_do_command(card, APP_CMD, 0, NULL)) + return -1; + return spi_sdcard_do_command_help(card, 1, cmd, argument, out_register); }