Skip to content

Commit

Permalink
tty: Fix unbalanced BKL handling in error path
Browse files Browse the repository at this point in the history
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>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed May 13, 2010
1 parent e6114fa commit 77945fe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,7 @@ static int tty_open(struct inode *inode, struct file *filp)
*/
if (filp->f_op == &hung_up_tty_fops)
filp->f_op = &tty_fops;
unlock_kernel();
goto retry_open;
}
unlock_kernel();
Expand Down

0 comments on commit 77945fe

Please sign in to comment.