Commit 6ee96cc0 authored by Andreas Larsson's avatar Andreas Larsson Committed by Felipe Balbi

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: default avatarDavid Binderman <dcb314@hotmail.com>
Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 7adb5c87
...@@ -1532,8 +1532,9 @@ static int gr_ep_enable(struct usb_ep *_ep, ...@@ -1532,8 +1532,9 @@ static int gr_ep_enable(struct usb_ep *_ep,
"%s mode: multiple trans./microframe not valid\n", "%s mode: multiple trans./microframe not valid\n",
(mode == 2 ? "Bulk" : "Control")); (mode == 2 ? "Bulk" : "Control"));
return -EINVAL; return -EINVAL;
} else if (nt == 0x11) { } else if (nt == 0x3) {
dev_err(dev->dev, "Invalid value for trans./microframe\n"); dev_err(dev->dev,
"Invalid value 0x3 for additional trans./microframe\n");
return -EINVAL; return -EINVAL;
} else if ((nt + 1) * max > buffer_size) { } else if ((nt + 1) * max > buffer_size) {
dev_err(dev->dev, "Hw buffer size %d < max payload %d * %d\n", dev_err(dev->dev, "Hw buffer size %d < max payload %d * %d\n",
......
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