projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d17d535
)
usb: musb: check for zero byte in musb_read/write_fifo
author
Ajay Kumar Gupta
<ajay.gupta@ti.com>
Fri, 20 Jul 2012 05:37:24 +0000
(11:07 +0530)
committer
Felipe Balbi
<balbi@ti.com>
Fri, 3 Aug 2012 06:34:41 +0000
(09:34 +0300)
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>
drivers/usb/musb/musb_core.c
patch
|
blob
|
history
diff --git
a/drivers/usb/musb/musb_core.c
b/drivers/usb/musb/musb_core.c
index 26f1befb489677a7d214bcb90b26bf1775f67733..69711e43ac6b2e1073269a36b0607b984b70f6ca 100644
(file)
--- 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)
struct musb *musb = hw_ep->musb;
void __iomem *fifo = hw_ep->fifo;
+ if (unlikely(len == 0))
+ return;
+
prefetch((u8 *)src);
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)
struct musb *musb = hw_ep->musb;
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",
'R', hw_ep->epnum, fifo, len, dst);