stm32mon: : fix coverity scan issue on a write_wrapper() call

This CL fixes coverity scan check issue, which points that there is
a call to write_wrapper() missing return value checking.
This was added by crrev.com/c/1540496, which is about a sending
garbage byte to DUT to avoid reTIMEOUT response repeating.

BUG=b:131231369
BRANCH=none
TEST=ran flash_ec on scarlet at 9600 bps.

flash_ec --board scarlet --image ${IMG} --bitbang_rate 9600

Change-Id: I25ea43ae13d9fbf16b90fba4030c9bb640498453
Signed-off-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1588497
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
This commit is contained in:
Namyoon Woo 2019-04-29 09:03:33 -07:00 committed by chrome-bot
parent e433b0068b
commit b3b26123ef
1 changed files with 7 additions and 1 deletions

View File

@ -697,7 +697,13 @@ int send_command_retry(int fd, uint8_t cmd, payload_t *loads,
while (res == STM32_ETIMEDOUT && ack_tries--) {
if (cmd == CMD_WRITEMEM) {
/* send garbage byte */
write_wrapper(fd, loads->data, 1);
res = write_wrapper(fd, loads->data, 1);
/* Don't care much since it is a garbage
* transfer to let the device not wait for
* any missing data, if any.
*/
if (res < 0)
fprintf(stderr, "warn: write failed\n");
}
res = wait_for_ack(fd);
}