From a1fb657fc7e31c9b908ab0233811e8800a72b870 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Mon, 11 Feb 2008 15:22:29 +0100 Subject: [PATCH] --- yaml --- r: 86059 b: refs/heads/master c: 94409cc1e507b157f8442dad80ff5e560c3205e5 h: refs/heads/master i: 86057: 8c374645f10b1106d1ec369f6e56dab58660db3c 86055: 611038c895a0a6b735e45534f529e386e5629b1e v: v3 --- [refs] | 2 +- trunk/drivers/usb/class/cdc-acm.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 20538b869a54..85645eadc1a8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 59036e94732edc2fb957465008c68bbcfc6736fa +refs/heads/master: 94409cc1e507b157f8442dad80ff5e560c3205e5 diff --git a/trunk/drivers/usb/class/cdc-acm.c b/trunk/drivers/usb/class/cdc-acm.c index bcc42136c93f..0147ea39340e 100644 --- a/trunk/drivers/usb/class/cdc-acm.c +++ b/trunk/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 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) usb_autopm_put_interface(acm->control); acm->used--; mutex_unlock(&acm->mutex); +early_bail: + mutex_unlock(&open_mutex); return -EIO; }