diff options
author | Ajay Kumar Gupta <ajay.gupta@ti.com> | 2012-07-20 01:37:24 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-08-03 02:34:41 -0400 |
commit | 603fe2b21d9fcde2022f9b52d95027bea29fe9e3 (patch) | |
tree | 7cd9398bb5f39ae84655344f8fa1c7beaea261ed /drivers/usb/musb | |
parent | d17d535fec07dbd298b3f65838ec8d63c26ab360 (diff) |
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: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 26f1befb4896..69711e43ac6b 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -234,6 +234,9 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) | |||
234 | struct musb *musb = hw_ep->musb; | 234 | struct musb *musb = hw_ep->musb; |
235 | void __iomem *fifo = hw_ep->fifo; | 235 | void __iomem *fifo = hw_ep->fifo; |
236 | 236 | ||
237 | if (unlikely(len == 0)) | ||
238 | return; | ||
239 | |||
237 | prefetch((u8 *)src); | 240 | prefetch((u8 *)src); |
238 | 241 | ||
239 | dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", | 242 | 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 | struct musb *musb = hw_ep->musb; | 279 | struct musb *musb = hw_ep->musb; |
277 | void __iomem *fifo = hw_ep->fifo; | 280 | void __iomem *fifo = hw_ep->fifo; |
278 | 281 | ||
282 | if (unlikely(len == 0)) | ||
283 | return; | ||
284 | |||
279 | dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", | 285 | dev_dbg(musb->controller, "%cX ep%d fifo %p count %d buf %p\n", |
280 | 'R', hw_ep->epnum, fifo, len, dst); | 286 | 'R', hw_ep->epnum, fifo, len, dst); |
281 | 287 | ||