Commit 603fe2b2 authored by Ajay Kumar Gupta's avatar Ajay Kumar Gupta Committed by Felipe Balbi

usb: musb: check for zero byte in musb_read/write_fifo

Added a check in musb_{read | write}_fifo for zero byte length.
Signed-off-by: default avatarAjay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d17d535f
...@@ -234,6 +234,9 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) ...@@ -234,6 +234,9 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
struct musb *musb = hw_ep->musb; struct musb *musb = hw_ep->musb;
void __iomem *fifo = hw_ep->fifo; void __iomem *fifo = hw_ep->fifo;
if (unlikely(len == 0))
return;
prefetch((u8 *)src); prefetch((u8 *)src);
dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n",
...@@ -276,6 +279,9 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) ...@@ -276,6 +279,9 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
struct musb *musb = hw_ep->musb; struct musb *musb = hw_ep->musb;
void __iomem *fifo = hw_ep->fifo; void __iomem *fifo = hw_ep->fifo;
if (unlikely(len == 0))
return;
dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n",
'R', hw_ep->epnum, fifo, len, dst); 'R', hw_ep->epnum, fifo, len, dst);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment