summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-11-30 13:18:40 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 15:18:08 -0800
commit38c70b27f9502c31c1d0c29676275f7362cdb0d9 (patch)
treef7545467d3c060a9df2940f731524b74d2f8c2dd /drivers
parentf18f9498e90327b9b0e245e191029e6e1996d203 (diff)
downloadlinux-38c70b27f9502c31c1d0c29676275f7362cdb0d9.tar.bz2
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/tty_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index c408c81c06a0..cc941a3504d7 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -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) {
@@ -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 ? */