summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]drivers/usb/gadget/f_fastboot.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 31969d8..b1382dd 100644..100755
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -3097,15 +3097,16 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req)
if (strncmp(cmd, "gpt", 3) == 0) {
gpt_valid_pst = partition_table_valid();
- /* If gpt invalid -> valid, write unlock status, also wipe data. */
- if ((gpt_valid_pre == 0) && (gpt_valid_pst == 1))
- do_fastboot_unlock();
-
/* If gpt is valid, load partitons table into memory.
So if the next command is "fastboot reboot bootloader",
it can find the "misc" partition to r/w. */
if(gpt_valid_pst)
_fastboot_load_partitions();
+
+ /* If gpt invalid -> valid, write unlock status, also wipe data. */
+ if ((gpt_valid_pre == 0) && (gpt_valid_pst == 1)) {
+ do_fastboot_unlock();
+ }
}
#endif
#else