Commit 6b216df8 authored by Conger, Chris A's avatar Conger, Chris A Committed by Linus Torvalds

[PATCH] USB: fix Bug in usb-skeleton.c

Compare endpoint address to USB_ENDPOINT_DIR_MASK to determine endpoint
direction...

From: "Conger, Chris A." <CHRIS.A.CONGER@saic.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3eb0c5f4
...@@ -257,7 +257,8 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i ...@@ -257,7 +257,8 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
endpoint = &iface_desc->endpoint[i].desc; endpoint = &iface_desc->endpoint[i].desc;
if (!dev->bulk_in_endpointAddr && 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) ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK)) { == USB_ENDPOINT_XFER_BULK)) {
/* we found a bulk in endpoint */ /* we found a bulk in endpoint */
...@@ -272,7 +273,8 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i ...@@ -272,7 +273,8 @@ static int skel_probe(struct usb_interface *interface, const struct usb_device_i
} }
if (!dev->bulk_out_endpointAddr && 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) ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK)) { == USB_ENDPOINT_XFER_BULK)) {
/* we found a bulk out endpoint */ /* we found a bulk out endpoint */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment