stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "usb: gadget: composite: correctly initialize ep->maxpacket" has been added to the 4.9-stable tree
@ 2017-01-03 19:57 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-01-03 19:57 UTC (permalink / raw)
  To: felipe.balbi, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    usb: gadget: composite: correctly initialize ep->maxpacket

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-gadget-composite-correctly-initialize-ep-maxpacket.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From e8f29bb719b47a234f33b0af62974d7a9521a52c Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@linux.intel.com>
Date: Wed, 28 Sep 2016 10:38:11 +0300
Subject: usb: gadget: composite: correctly initialize ep->maxpacket

From: Felipe Balbi <felipe.balbi@linux.intel.com>

commit e8f29bb719b47a234f33b0af62974d7a9521a52c upstream.

usb_endpoint_maxp() returns wMaxPacketSize in its
raw form. Without taking into consideration that it
also contains other bits reserved for isochronous
endpoints.

This patch fixes one occasion where this is a
problem by making sure that we initialize
ep->maxpacket only with lower 10 bits of the value
returned by usb_endpoint_maxp(). Note that seperate
patches will be necessary to audit all call sites of
usb_endpoint_maxp() and make sure that
usb_endpoint_maxp() only returns lower 10 bits of
wMaxPacketSize.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/gadget/composite.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -197,7 +197,7 @@ int config_ep_by_speed(struct usb_gadget
 
 ep_found:
 	/* commit results */
-	_ep->maxpacket = usb_endpoint_maxp(chosen_desc);
+	_ep->maxpacket = usb_endpoint_maxp(chosen_desc) & 0x7ff;
 	_ep->desc = chosen_desc;
 	_ep->comp_desc = NULL;
 	_ep->maxburst = 0;


Patches currently in stable-queue which might be from felipe.balbi@linux.intel.com are

queue-4.9/usb-gadget-composite-always-set-ep-mult-to-a-sensible-value.patch
queue-4.9/usb-gadget-f_uac2-fix-error-handling-at-afunc_bind.patch
queue-4.9/usb-dwc3-gadget-set-pcm1-field-of-isochronous-first-trbs.patch
queue-4.9/usb-gadget-composite-correctly-initialize-ep-maxpacket.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-03 19:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-03 19:57 Patch "usb: gadget: composite: correctly initialize ep->maxpacket" has been added to the 4.9-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).