cmd: usbdown: handle error of file load command during update
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 25 Jul 2017 05:20:23 +0000 (14:20 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 10 Oct 2019 04:38:39 +0000 (13:38 +0900)
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 <sw0312.kim@samsung.com>
cmd/usbdown.c

index 4ff6aec..9257304 100644 (file)
@@ -414,8 +414,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";