diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | 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 bcc42136c93f..0147ea39340e 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) | |||
496 | otherwise it is scheduled, and with high data rates data can get lost. */ | 496 | otherwise it is scheduled, and with high data rates data can get lost. */ |
497 | tty->low_latency = 1; | 497 | tty->low_latency = 1; |
498 | 498 | ||
499 | if (usb_autopm_get_interface(acm->control)) { | 499 | if (usb_autopm_get_interface(acm->control) < 0) |
500 | mutex_unlock(&open_mutex); | 500 | goto early_bail; |
501 | return -EIO; | ||
502 | } | ||
503 | 501 | ||
504 | mutex_lock(&acm->mutex); | 502 | mutex_lock(&acm->mutex); |
505 | mutex_unlock(&open_mutex); | ||
506 | if (acm->used++) { | 503 | if (acm->used++) { |
507 | usb_autopm_put_interface(acm->control); | 504 | usb_autopm_put_interface(acm->control); |
508 | goto done; | 505 | goto done; |
@@ -536,6 +533,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) | |||
536 | done: | 533 | done: |
537 | err_out: | 534 | err_out: |
538 | mutex_unlock(&acm->mutex); | 535 | mutex_unlock(&acm->mutex); |
536 | mutex_unlock(&open_mutex); | ||
539 | return rv; | 537 | return rv; |
540 | 538 | ||
541 | full_bailout: | 539 | full_bailout: |
@@ -544,6 +542,8 @@ bail_out: | |||
544 | usb_autopm_put_interface(acm->control); | 542 | usb_autopm_put_interface(acm->control); |
545 | acm->used--; | 543 | acm->used--; |
546 | mutex_unlock(&acm->mutex); | 544 | mutex_unlock(&acm->mutex); |
545 | early_bail: | ||
546 | mutex_unlock(&open_mutex); | ||
547 | return -EIO; | 547 | return -EIO; |
548 | } | 548 | } |
549 | 549 | ||