Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=94409cc1e507b157f8442dad80ff5e560c3205e5
Commit:     94409cc1e507b157f8442dad80ff5e560c3205e5
Parent:     59036e94732edc2fb957465008c68bbcfc6736fa
Author:     Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 11 15:22:29 2008 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Feb 21 15:38:49 2008 -0800

    USB: fix usb open suspend race in cdc-acm
    
    this fixes a race between open and disconnect in the CDC ACM driver.
    
    Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/class/cdc-acm.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index bcc4213..0147ea3 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -496,13 +496,10 @@ static int acm_tty_open(struct tty_struct *tty, struct 
file *filp)
           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_struct *tty, struct file 
*filp)
 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 git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to