Commit 38c70b27 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

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: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f18f9498
...@@ -505,8 +505,6 @@ static void do_tty_hangup(struct work_struct *work) ...@@ -505,8 +505,6 @@ static void do_tty_hangup(struct work_struct *work)
if (!tty) if (!tty)
return; return;
/* inuse_filps is protected by the single kernel lock */
lock_kernel();
spin_lock(&redirect_lock); spin_lock(&redirect_lock);
if (redirect && redirect->private_data == tty) { if (redirect && redirect->private_data == tty) {
...@@ -515,6 +513,8 @@ static void do_tty_hangup(struct work_struct *work) ...@@ -515,6 +513,8 @@ static void do_tty_hangup(struct work_struct *work)
} }
spin_unlock(&redirect_lock); spin_unlock(&redirect_lock);
/* inuse_filps is protected by the single kernel lock */
lock_kernel();
check_tty_count(tty, "do_tty_hangup"); check_tty_count(tty, "do_tty_hangup");
file_list_lock(); file_list_lock();
/* This breaks for file handles being sent over AF_UNIX sockets ? */ /* This breaks for file handles being sent over AF_UNIX sockets ? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment