mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
usb: dwc2: Fix in ISOC request length checking
commit860ef6cd3f
upstream. Moved ISOC request length checking from dwc2_hsotg_start_req() function to dwc2_hsotg_ep_queue(). Fixes:4fca54aa58
("usb: gadget: s3c-hsotg: add multi count support") Signed-off-by: Minas Harutyunyan <hminas@synopsys.com> Signed-off-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
de8dbb7b02
commit
f8e6a3412d
1 changed files with 7 additions and 5 deletions
|
@ -1004,11 +1004,6 @@ static void dwc2_hsotg_start_req(struct dwc2_hsotg *hsotg,
|
|||
else
|
||||
packets = 1; /* send one packet if length is zero. */
|
||||
|
||||
if (hs_ep->isochronous && length > (hs_ep->mc * hs_ep->ep.maxpacket)) {
|
||||
dev_err(hsotg->dev, "req length > maxpacket*mc\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (dir_in && index != 0)
|
||||
if (hs_ep->isochronous)
|
||||
epsize = DXEPTSIZ_MC(packets);
|
||||
|
@ -1312,6 +1307,13 @@ static int dwc2_hsotg_ep_queue(struct usb_ep *ep, struct usb_request *req,
|
|||
req->actual = 0;
|
||||
req->status = -EINPROGRESS;
|
||||
|
||||
/* Don't queue ISOC request if length greater than mps*mc */
|
||||
if (hs_ep->isochronous &&
|
||||
req->length > (hs_ep->mc * hs_ep->ep.maxpacket)) {
|
||||
dev_err(hs->dev, "req length > maxpacket*mc\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* In DDMA mode for ISOC's don't queue request if length greater
|
||||
* than descriptor limits.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue