From 511e7b88b9f68270916b76c4c8af58365b6919bf Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Tue, 25 Jul 2017 14:20:23 +0900 Subject: [PATCH] cmd: usbdown: handle error of file load command during update The error of file load command from usb storage during update command is not handled, so wrong data is stored in the file for the case. Handle error of file load command during update not to store bad file. Change-Id: I4c7338eaea538e656ef52ce8c7214f71d0089b4a Signed-off-by: Seung-Woo Kim --- cmd/usbdown.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/usbdown.c b/cmd/usbdown.c index 1badfe1e2e..28d1eed9a4 100644 --- a/cmd/usbdown.c +++ b/cmd/usbdown.c @@ -411,8 +411,9 @@ int do_update(cmd_tbl_t *cmdtp, int flags, int argc, char * const argv[]) " %p", (void *)addr); sprintf(cmd_buf + strlen(cmd_buf), " %s", usbdown->name); - - run_command(cmd_buf, 0); + ret = run_command(cmd_buf, 0); + if (ret != CMD_RET_SUCCESS) + return ret; /* Write file */ opname = "write"; -- 2.34.1