diff options
author | Andreas Larsson <andreas@gaisler.com> | 2014-06-26 13:07:48 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-06-27 10:53:07 -0500 |
commit | 6ee96cc0004c084df22fc1d5d9e2cef2d38d8010 (patch) | |
tree | 22bd717029f5b233d09cc972fd5a790cede7ec8a /drivers/usb | |
parent | 7adb5c876e9c0677078a1e1094c6eafd29c30b74 (diff) |
usb: gadget: gr_udc: Fix check for invalid number of microframes
The value 0x3 (not 0x11) in the field for additional transaction/microframe
is reserved and should not be let through. Be clear in the error message about
what value caused the error return.
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/gr_udc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/gr_udc.c b/drivers/usb/gadget/gr_udc.c index 99a37ed03e27..c7004ee89c90 100644 --- a/drivers/usb/gadget/gr_udc.c +++ b/drivers/usb/gadget/gr_udc.c @@ -1532,8 +1532,9 @@ static int gr_ep_enable(struct usb_ep *_ep, "%s mode: multiple trans./microframe not valid\n", (mode == 2 ? "Bulk" : "Control")); return -EINVAL; - } else if (nt == 0x11) { - dev_err(dev->dev, "Invalid value for trans./microframe\n"); + } else if (nt == 0x3) { + dev_err(dev->dev, + "Invalid value 0x3 for additional trans./microframe\n"); return -EINVAL; } else if ((nt + 1) * max > buffer_size) { dev_err(dev->dev, "Hw buffer size %d < max payload %d * %d\n", |