aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_gadget_ep0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/musb/musb_gadget_ep0.c')
-rw-r--r--drivers/usb/musb/musb_gadget_ep0.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index c9c1ac4e075f..2af45a0c8930 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -505,8 +505,10 @@ static void ep0_rxstate(struct musb *musb)
505 req->status = -EOVERFLOW; 505 req->status = -EOVERFLOW;
506 count = len; 506 count = len;
507 } 507 }
508 musb_read_fifo(&musb->endpoints[0], count, buf); 508 if (count > 0) {
509 req->actual += count; 509 musb_read_fifo(&musb->endpoints[0], count, buf);
510 req->actual += count;
511 }
510 csr = MUSB_CSR0_P_SVDRXPKTRDY; 512 csr = MUSB_CSR0_P_SVDRXPKTRDY;
511 if (count < 64 || req->actual == req->length) { 513 if (count < 64 || req->actual == req->length) {
512 musb->ep0_state = MUSB_EP0_STAGE_STATUSIN; 514 musb->ep0_state = MUSB_EP0_STAGE_STATUSIN;