Skip to content

Commit

Permalink
usb: chipidea: udc: don't truncate requests to single tds
Browse files Browse the repository at this point in the history
It is not safe to truncate requests to the maximum possible size the
controller can handle with one td and to keep working. That patch fixes
that with proper error handling instead.

Reported-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Michael Grzeschik authored and Greg Kroah-Hartman committed Mar 30, 2013
1 parent 9e50643 commit 24dcade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,9 +1158,9 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req,
}

if (req->length > 4 * CI13XXX_PAGE_SIZE) {
req->length = 4 * CI13XXX_PAGE_SIZE;
retval = -EMSGSIZE;
dev_warn(mEp->ci->dev, "request length truncated\n");
dev_err(mEp->ci->dev, "request bigger than one td\n");
goto done;
}

/* push request */
Expand Down

0 comments on commit 24dcade

Please sign in to comment.