summaryrefslogtreecommitdiffstats
path: root/drivers/tty/vt/vt.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-03-02 14:59:37 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 11:10:27 -0800
commit20f62579dccc84428554b914e24a312a6554f841 (patch)
treebd6b0f2724d75ba7fd17bb6422bfa05505018474 /drivers/tty/vt/vt.c
parent4001d7b7fc271052ebff43f327c26dc64806bbdf (diff)
downloadtalos-op-linux-20f62579dccc84428554b914e24a312a6554f841.tar.gz
talos-op-linux-20f62579dccc84428554b914e24a312a6554f841.zip
vt: push down tioclinux cases
Some of this ventures into selection which is still a complete lost cause. We are not making it any worse. It's completely busted anyway. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt/vt.c')
-rw-r--r--drivers/tty/vt/vt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index ce2b82343620..ab7385e526af 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2637,11 +2637,15 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
ret = __put_user(data, p);
break;
case TIOCL_GETMOUSEREPORTING:
+ console_lock(); /* May be overkill */
data = mouse_reporting();
+ console_unlock();
ret = __put_user(data, p);
break;
case TIOCL_SETVESABLANK:
+ console_lock();
ret = set_vesa_blanking(p);
+ console_unlock();
break;
case TIOCL_GETKMSGREDIRECT:
data = vt_get_kmsg_redirect();
@@ -2658,13 +2662,21 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
}
break;
case TIOCL_GETFGCONSOLE:
+ /* No locking needed as this is a transiently
+ correct return anyway if the caller hasn't
+ disabled switching */
ret = fg_console;
break;
case TIOCL_SCROLLCONSOLE:
if (get_user(lines, (s32 __user *)(p+4))) {
ret = -EFAULT;
} else {
+ /* Need the console lock here. Note that lots
+ of other calls need fixing before the lock
+ is actually useful ! */
+ console_lock();
scrollfront(vc_cons[fg_console].d, lines);
+ console_unlock();
ret = 0;
}
break;
OpenPOWER on IntegriCloud