Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24dcade1 authored by Michael Grzeschik's avatar Michael Grzeschik Committed by Greg Kroah-Hartman
Browse files

usb: chipidea: udc: don't truncate requests to single tds



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: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9e506438
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 */