From: Benjamin Herrenschmidt Date: Fri, 12 Jan 2018 06:50:02 +0000 (+1100) Subject: usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2ba5966eddefdf04306bd1da36811c8b83a9664d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc() commit 11fb37998759c48e4e4c200c974593cbeab25d3e upstream. 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index 284bd1a7b570..794bb4958383 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -923,7 +923,7 @@ int usb_gadget_ep_match_desc(struct usb_gadget *gadget, return 0; /* "high bandwidth" works only at high speed */ - if (!gadget_is_dualspeed(gadget) && usb_endpoint_maxp(desc) & (3<<11)) + if (!gadget_is_dualspeed(gadget) && usb_endpoint_maxp_mult(desc) > 1) return 0; switch (type) {