From: Conger, Chris A Date: Fri, 29 Jul 2005 19:18:23 +0000 (-0700) Subject: [PATCH] USB: fix Bug in usb-skeleton.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6b216df87cb5f3bb7d47a33f1cd955ebc7b84dfd;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [PATCH] USB: fix Bug in usb-skeleton.c Compare endpoint address to USB_ENDPOINT_DIR_MASK to determine endpoint direction... From: "Conger, Chris A." Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 6051a646fe6..353f24d45bc 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -257,7 +257,8 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i endpoint = &iface_desc->endpoint[i].desc; if (!dev->bulk_in_endpointAddr && - (endpoint->bEndpointAddress & USB_DIR_IN) && + ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) + == USB_DIR_IN) && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK)) { /* we found a bulk in endpoint */ @@ -272,7 +273,8 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i } if (!dev->bulk_out_endpointAddr && - !(endpoint->bEndpointAddress & USB_DIR_OUT) && + ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) + == USB_DIR_OUT) && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK)) { /* we found a bulk out endpoint */