Skip to content

Commit

Permalink
tty: Push the bkl down a bit in the hangup code
Browse files Browse the repository at this point in the history
We know that the redirect field is handled via its own locking in all
places

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Alan Cox authored and gregkh committed Dec 11, 2009
1 parent f18f949 commit 38c70b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,6 @@ static void do_tty_hangup(struct work_struct *work)
if (!tty)
return;

/* inuse_filps is protected by the single kernel lock */
lock_kernel();

spin_lock(&redirect_lock);
if (redirect && redirect->private_data == tty) {
Expand All @@ -515,6 +513,8 @@ static void do_tty_hangup(struct work_struct *work)
}
spin_unlock(&redirect_lock);

/* inuse_filps is protected by the single kernel lock */
lock_kernel();
check_tty_count(tty, "do_tty_hangup");
file_list_lock();
/* This breaks for file handles being sent over AF_UNIX sockets ? */
Expand Down

0 comments on commit 38c70b2

Please sign in to comment.