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>
This commit is contained in:
John Zhao 2020-09-22 11:12:37 -07:00 committed by Patrick Georgi
parent 920d2b77f2
commit 19e22f554e
1 changed files with 3 additions and 1 deletions

View File

@ -354,7 +354,9 @@ static int spi_sdcard_do_app_command(const struct spi_sdcard *card,
uint32_t *out_register) uint32_t *out_register)
{ {
/* CMD55 */ /* 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); return spi_sdcard_do_command_help(card, 1, cmd, argument, out_register);
} }