aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-07-23 21:29:58 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 10:47:30 -0700
commite0426e6a09954d205da2d674a3d368d2715e3afd (patch)
treefcdc9863df9b7458f51730aaf8ab022dd87fcc84
parentbbe48ecc7f6559318cfc6c023da225a0b0e14ab3 (diff)
vt: hold console_sem across sysfs operations
Hold console sem while creating/destroying sysfs files. Serialisation is so far done by BKL held in tty release_dev and chrdev_open, but no other locks are held in open path. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Aristeu Rozanski <aris@ruivo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/char/vt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index e32a076d5f1..ab53a1d4d89 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2749,8 +2749,8 @@ static int con_open(struct tty_struct *tty, struct file *filp)
tty->termios->c_iflag |= IUTF8;
else
tty->termios->c_iflag &= ~IUTF8;
- release_console_sem();
vcs_make_sysfs(tty);
+ release_console_sem();
return ret;
}
}
@@ -2775,8 +2775,8 @@ static void con_close(struct tty_struct *tty, struct file *filp)
if (vc)
vc->vc_tty = NULL;
tty->driver_data = NULL;
- release_console_sem();
vcs_remove_sysfs(tty);
+ release_console_sem();
mutex_unlock(&tty_mutex);
/*
* tty_mutex is released, but we still hold BKL, so there is