cmd: usbdown: handle error of file load command during update 35/140735/2
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 25 Jul 2017 05:20:23 +0000 (14:20 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 27 Jul 2017 03:15:36 +0000 (12:15 +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 1badfe1e2e5e23fc4c3c5b0a9a01772ea1161106..28d1eed9a43343b8dfdefdc53199b9a22e7e6986 100644 (file)
@@ -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";