summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authoryurii.pidhornyi <yurii.pidhornyi@globallogic.com>2020-08-20 18:41:18 +0300
committerMarek Vasut <marex@denx.de>2020-09-01 15:47:43 +0300
commit64af06ce91d1b2f7819a273e56f7c41186a7588b (patch)
tree9e91472cc6074433e805acf42af61d4c7475bdab /drivers/usb/gadget
parent405217a0332aa33e33fb579d75bc7f420c27bcd1 (diff)
downloadu-boot-64af06ce91d1b2f7819a273e56f7c41186a7588b.tar.xz
fastboot: Fix fastboot reboot fail by changing functions order
It was revealed that when the fastboot_tx_write_str function is called without the previously initialized fastboot_func->in_req->complete field, a copy of in_req will be sent to the I/O requests queue without an initialized field. Moving a piece of code with the initializing of the fastboot_func->in_req->complete field above transmit_tx allows to solve this problem. Fixes: 65c96757fe9 "usb: fastboot: Convert USB f_fastboot to shared fastboot" Signed-off-by: yurii.pidhornyi <yurii.pidhornyi@globallogic.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_fastboot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 30f7a52087..d1d087e12b 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -441,8 +441,6 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
req->length = rx_bytes_expected(ep);
}
- fastboot_tx_write_str(response);
-
if (!strncmp("OKAY", response, 4)) {
switch (cmd) {
case FASTBOOT_COMMAND_BOOT:
@@ -462,6 +460,8 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
}
}
+ fastboot_tx_write_str(response);
+
*cmdbuf = '\0';
req->actual = 0;
usb_ep_queue(ep, req, 0);