]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
usb/gadget: Fix "high bandwidth" check in usb_gadget_ep_match_desc()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 12 Jan 2018 06:50:02 +0000 (17:50 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jan 2018 14:34:37 +0000 (15:34 +0100)
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>
drivers/usb/gadget/udc/core.c

index 1b3efb14aec7878e616a3a1a7588046e2641aec7..ac0541529499473208c06e669464d0f6b7bd3d0a 100644 (file)
@@ -912,7 +912,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) {