Commit 38c70b27f9502c31c1d0c29676275f7362cdb0d9

Authored by Alan Cox
Committed by Greg Kroah-Hartman
1 parent f18f9498e9

tty: Push the bkl down a bit in the hangup code

We know that the redirect field is handled via its own locking in all
places

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/char/tty_io.c
... ... @@ -505,8 +505,6 @@
505 505 if (!tty)
506 506 return;
507 507  
508   - /* inuse_filps is protected by the single kernel lock */
509   - lock_kernel();
510 508  
511 509 spin_lock(&redirect_lock);
512 510 if (redirect && redirect->private_data == tty) {
... ... @@ -515,6 +513,8 @@
515 513 }
516 514 spin_unlock(&redirect_lock);
517 515  
  516 + /* inuse_filps is protected by the single kernel lock */
  517 + lock_kernel();
518 518 check_tty_count(tty, "do_tty_hangup");
519 519 file_list_lock();
520 520 /* This breaks for file handles being sent over AF_UNIX sockets ? */