]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
tty: Fix unbalanced BKL handling in error path
authorAlan Cox <alan@linux.intel.com>
Tue, 4 May 2010 19:42:36 +0000 (20:42 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 26 May 2010 21:32:07 +0000 (14:32 -0700)
commit 77945febbe60a69e9dcab7f49d33a1aa1e436973 upstream.

Arnd noted:

After the "retry_open:" label, we first get the tty_mutex
and then the BKL. However a the end of tty_open, we jump
back to retry_open with the BKL still held. If we run into
this case, the tty_open function will be left with the BKL
still held.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/tty_io.c

index 76253cf27028c2873ca7d940248f11aa27e207a4..9af6766117597c1393ca1685ca921c5a6ec63dfc 100644 (file)
@@ -1875,6 +1875,7 @@ got_driver:
                 */
                if (filp->f_op == &hung_up_tty_fops)
                        filp->f_op = &tty_fops;
+               unlock_kernel();
                goto retry_open;
        }
        unlock_kernel();