Hi,
this fixes a race between open and disconnect in the CDC ACM driver.
Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
Regards
Oliver
----
--- linux-2.6/drivers/usb/class/cdc-acm.c.alt 2008-02-11 15:10:48.000000000
+0100
+++ linux-2.6/drivers/usb/class/cdc-acm.c 2008-02-11 15:13:07.000000000
+0100
@@ -496,13 +496,10 @@ static int acm_tty_open(struct tty_struc
otherwise it is scheduled, and with high data rates data can get
lost. */
tty->low_latency = 1;
- if (usb_autopm_get_interface(acm->control)) {
- mutex_unlock(&open_mutex);
- return -EIO;
- }
+ if (usb_autopm_get_interface(acm->control) < 0)
+ goto early_bail;
mutex_lock(&acm->mutex);
- mutex_unlock(&open_mutex);
if (acm->used++) {
usb_autopm_put_interface(acm->control);
goto done;
@@ -536,6 +533,7 @@ static int acm_tty_open(struct tty_struc
done:
err_out:
mutex_unlock(&acm->mutex);
+ mutex_unlock(&open_mutex);
return rv;
full_bailout:
@@ -544,6 +542,8 @@ bail_out:
usb_autopm_put_interface(acm->control);
acm->used--;
mutex_unlock(&acm->mutex);
+early_bail:
+ mutex_unlock(&open_mutex);
return -EIO;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html