summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r--payloads/libpayload/drivers/udc/udc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/payloads/libpayload/drivers/udc/udc.c b/payloads/libpayload/drivers/udc/udc.c
index 23c319bbe4..e01b4546fe 100644
--- a/payloads/libpayload/drivers/udc/udc.c
+++ b/payloads/libpayload/drivers/udc/udc.c
@@ -168,9 +168,10 @@ static int setup_ep0(struct usbdev_ctrl *this, dev_req_t *dr)
res[0] = this->current_config_id;
/* data phase IN */
- this->enqueue_packet(this, 0, 1, res, 1, 0, 1);
+ this->enqueue_packet(this, 0, 1, res, min(1, dr->wLength),
+ 0, 1);
- // status phase OUT
+ /* status phase OUT */
this->enqueue_packet(this, 0, 0, NULL, 0, 0, 0);
return 1;
} else