From cee79a804e808ed70f4c307fb26c565f95213352 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 1 Oct 2007 01:20:12 -0700 Subject: [PATCH] --- yaml --- r: 65227 b: refs/heads/master c: 8792f961ba8057d9f27987def3600253a3ba060f h: refs/heads/master i: 65225: 3845f2a2ef7222309c2c2fe454f71ba2279fa6d1 65223: 62499a42e5862341c23b46815c9cdd056abeb8da v: v3 --- [refs] | 2 +- trunk/drivers/char/vt_ioctl.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index a8744d239c5c..473e65cf6fd9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4047727e5ae33f9b8d2b7766d1994ea6e5ec2991 +refs/heads/master: 8792f961ba8057d9f27987def3600253a3ba060f diff --git a/trunk/drivers/char/vt_ioctl.c b/trunk/drivers/char/vt_ioctl.c index 045e6888d15b..c799b7f7bbb3 100644 --- a/trunk/drivers/char/vt_ioctl.c +++ b/trunk/drivers/char/vt_ioctl.c @@ -770,6 +770,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, /* * Switching-from response */ + acquire_console_sem(); if (vc->vt_newvt >= 0) { if (arg == 0) /* @@ -784,7 +785,6 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * complete the switch. */ int newvt; - acquire_console_sem(); newvt = vc->vt_newvt; vc->vt_newvt = -1; i = vc_allocate(newvt); @@ -798,7 +798,6 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * other console switches.. */ complete_change_console(vc_cons[newvt].d); - release_console_sem(); } } @@ -810,9 +809,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, /* * If it's just an ACK, ignore it */ - if (arg != VT_ACKACQ) + if (arg != VT_ACKACQ) { + release_console_sem(); return -EINVAL; + } } + release_console_sem(); return 0;