summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/drivers/usb/dwc2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/payloads/libpayload/drivers/usb/dwc2.c b/payloads/libpayload/drivers/usb/dwc2.c
index 9d19bc6666..30e00fba64 100644
--- a/payloads/libpayload/drivers/usb/dwc2.c
+++ b/payloads/libpayload/drivers/usb/dwc2.c
@@ -283,7 +283,7 @@ dwc2_do_xfer(endpoint_t *ep, int size, int pid, ep_dir_t dir,
if (ret >= 0) {
/* Calculate actual transferred length */
- transferred = (dir == EPDIR_IN) ? inpkt_length - ret : ret;
+ transferred = (dir == EPDIR_IN) ? inpkt_length - ret : size;
if (do_copy && (dir == EPDIR_IN))
memcpy(data_buf, aligned_buf, transferred);