]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
USB: cdc-acm: don't unlock acm->mutex on error path
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 22 Aug 2008 17:40:10 +0000 (17:40 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Sep 2008 10:20:15 +0000 (03:20 -0700)
commit 74573ee7096a4ffc2f098108d21c85801b9c7434 upstream

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>
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 d8160faabb9d21986b16f351d382eb0295d5b6f9..9c2b7b4545febfa8a6e7e81db9c7fb3f97dc24d0 100644 (file)
@@ -531,8 +531,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;