Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()

The current code tries to test for bits that are masked out by
usb_endpoint_maxp(). Instead, use the proper accessor to access
the new high bandwidth bits.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Benjamin Herrenschmidt and committed by
Greg Kroah-Hartman
11fb3799 0cb5818a

+1 -1
+1 -1
drivers/usb/gadget/udc/core.c
··· 912 912 return 0; 913 913 914 914 /* "high bandwidth" works only at high speed */ 915 - if (!gadget_is_dualspeed(gadget) && usb_endpoint_maxp(desc) & (3<<11)) 915 + if (!gadget_is_dualspeed(gadget) && usb_endpoint_maxp_mult(desc) > 1) 916 916 return 0; 917 917 918 918 switch (type) {