Commit 3cd12261 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[PATCH] USB: CDC ACM module and Zoom 2985 modem

there's a bug in the acm driver's work arounds. This fixes it.
Signed-Off-By: default avatarOliver Neukum <oliver@neukum.name>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 57f7f426
...@@ -544,24 +544,24 @@ static int acm_probe (struct usb_interface *intf, ...@@ -544,24 +544,24 @@ static int acm_probe (struct usb_interface *intf,
/* normal probing*/ /* normal probing*/
if (!buffer) { if (!buffer) {
err("Wierd descriptor references"); err("Wierd descriptor references\n");
return -EINVAL; return -EINVAL;
} }
if (!buflen) { if (!buflen) {
if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) { if (intf->cur_altsetting->endpoint->extralen && intf->cur_altsetting->endpoint->extra) {
dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint"); dev_dbg(&intf->dev,"Seeking extra descriptors on endpoint\n");
buflen = intf->cur_altsetting->endpoint->extralen; buflen = intf->cur_altsetting->endpoint->extralen;
buffer = intf->cur_altsetting->endpoint->extra; buffer = intf->cur_altsetting->endpoint->extra;
} else { } else {
err("Zero length descriptor references"); err("Zero length descriptor references\n");
return -EINVAL; return -EINVAL;
} }
} }
while (buflen > 0) { while (buflen > 0) {
if (buffer [1] != USB_DT_CS_INTERFACE) { if (buffer [1] != USB_DT_CS_INTERFACE) {
err("skipping garbage"); err("skipping garbage\n");
goto next_desc; goto next_desc;
} }
...@@ -615,13 +615,9 @@ static int acm_probe (struct usb_interface *intf, ...@@ -615,13 +615,9 @@ static int acm_probe (struct usb_interface *intf,
} }
if (data_interface_num != call_interface_num) if (data_interface_num != call_interface_num)
dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported."); dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.\n");
skip_normal_probe: skip_normal_probe:
if (usb_interface_claimed(data_interface)) { /* valid in this context */
dev_dbg(&intf->dev,"The data interface isn't available\n");
return -EBUSY;
}
/*workaround for switched interfaces */ /*workaround for switched interfaces */
if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) { if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) {
...@@ -636,6 +632,13 @@ static int acm_probe (struct usb_interface *intf, ...@@ -636,6 +632,13 @@ static int acm_probe (struct usb_interface *intf,
return -EINVAL; return -EINVAL;
} }
} }
if (usb_interface_claimed(data_interface)) { /* valid in this context */
dev_dbg(&intf->dev,"The data interface isn't available\n");
return -EBUSY;
}
if (data_interface->cur_altsetting->desc.bNumEndpoints < 2) if (data_interface->cur_altsetting->desc.bNumEndpoints < 2)
return -EINVAL; return -EINVAL;
......
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