Commit 4f90b98e authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Use num_altsetting in usbnet and usbtest

This patch fixes usbnet and usbtest.  When checking endpoints, they
iterate through all interfaces out to intf->max_altsetting, but they
should only go up to intf->num_altsetting.  The max_altsetting value
refers to the amount of space _allocated_ for usb_host_interface
structures, not the number that are really in use.
parent 7e986ee5
......@@ -87,7 +87,7 @@ get_endpoints (struct usbtest_dev *dev, struct usb_interface *intf)
struct usb_host_endpoint *in, *out;
struct usb_device *udev;
for (tmp = 0; tmp < intf->max_altsetting; tmp++) {
for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
unsigned ep;
in = out = 0;
......
......@@ -312,7 +312,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf)
struct usb_host_interface *alt;
struct usb_host_endpoint *in, *out;
for (tmp = 0; tmp < intf->max_altsetting; tmp++) {
for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
unsigned ep;
in = out = 0;
......
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