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

usb: usbtest: bmAttributes would better be masked

When transfer type is isochronous, the other bits (bits 5..2) of
bmAttributes in endpoint descriptor might not be set zero. So it's better
to use usb_endpoint_type routine to mask bmAttributes with
USB_ENDPOINT_XFERTYPE_MASK to judge the transfter type later.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Huang Rui and committed by
Greg Kroah-Hartman
9a37a503 8eb41299

+1 -1
+1 -1
drivers/usb/misc/usbtest.c
··· 120 120 struct usb_host_endpoint *e; 121 121 122 122 e = alt->endpoint + ep; 123 - switch (e->desc.bmAttributes) { 123 + switch (usb_endpoint_type(&e->desc)) { 124 124 case USB_ENDPOINT_XFER_BULK: 125 125 break; 126 126 case USB_ENDPOINT_XFER_ISOC: