提交 538bf07d 编写于 作者: R Ravi Babu 提交者: Felipe Balbi

usb: musb: gadget: read ep0 fifo only if rxcount is non zero

avoid reading fifo rxcount is zero of fifo is empty, hence
read fifo only if rxcount is non-zero
Signed-off-by: NRavi Babu <ravibabu@ti.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 96449f09
......@@ -505,8 +505,10 @@ static void ep0_rxstate(struct musb *musb)
req->status = -EOVERFLOW;
count = len;
}
musb_read_fifo(&musb->endpoints[0], count, buf);
req->actual += count;
if (count > 0) {
musb_read_fifo(&musb->endpoints[0], count, buf);
req->actual += count;
}
csr = MUSB_CSR0_P_SVDRXPKTRDY;
if (count < 64 || req->actual == req->length) {
musb->ep0_state = MUSB_EP0_STAGE_STATUSIN;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册