tty: Fix unbalanced BKL handling in error path
authorAlan Cox <[email protected]>
Tue, 4 May 2010 19:42:36 +0000 (20:42 +0100)
committerGreg Kroah-Hartman <[email protected]>
Thu, 13 May 2010 19:10:56 +0000 (12:10 -0700)
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 <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/char/tty_io.c

index 6da962c9b21c880262a883db546ea1c8c7a99764..d71f0fc34b467c6e7a7c25c0762321f90b7e3fa0 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();