]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB: cdc-acm: don't unlock acm->mutex on error path
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 20 Aug 2008 23:56:04 +0000 (16:56 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Aug 2008 17:26:35 +0000 (10:26 -0700)
On Wed, Jul 23, 2008 at 03:52:36PM +0300, Andrei Popa wrote:
> I installed gnokii-0.6.22-r2 and gave the command "gnokii --identify"
> and the kernel oopsed:
>
> BUG: unable to handle kernel NULL pointer dereference at 00000458
> IP: [<c0444b52>] mutex_unlock+0x0/0xb
>  [<c03830ae>] acm_tty_open+0x4c/0x214

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Tested-by: Andrei Popa <andrei.popa@i-neo.ro>
Cc: stable <stable@kernel.org> [2.6.25.x, 2.6.26.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/cdc-acm.c

index 382522eb1f7e5936a663c258ca3b79396d68d7e2..c257453fa9dec42ea864b6cbd89dbd6a3cab5781 100644 (file)
@@ -589,8 +589,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
        tasklet_schedule(&acm->urb_task);
 
 done:
-err_out:
        mutex_unlock(&acm->mutex);
+err_out:
        mutex_unlock(&open_mutex);
        return rv;