Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4418015 authored by Linus Torvalds's avatar Linus Torvalds Committed by Greg Kroah-Hartman
Browse files

vt_kdsetmode: extend console locking



commit 2287a51ba822384834dafc1c798453375d1107c7 upstream.

As per the long-suffering comment.

Reported-by: default avatarMinh Yuan <yuanmingbuaa@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a19e004
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -484,16 +484,19 @@ int vt_ioctl(struct tty_struct *tty,
			ret = -EINVAL;
			goto out;
		}
		/* FIXME: this needs the console lock extending */
		if (vc->vc_mode == (unsigned char) arg)
		console_lock();
		if (vc->vc_mode == (unsigned char) arg) {
			console_unlock();
			break;
		}
		vc->vc_mode = (unsigned char) arg;
		if (console != fg_console)
		if (console != fg_console) {
			console_unlock();
			break;
		}
		/*
		 * explicitly blank/unblank the screen if switching modes
		 */
		console_lock();
		if (arg == KD_TEXT)
			do_unblank_screen(1);
		else