diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index fe37ec331289b227a31e2c6b967660a2f68bf85f..43413040ec34fede98d56362131aca2882efabcc 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -578,6 +578,16 @@ int tty_set_ldisc(struct tty_struct *tty, int disc) goto out; } +#ifdef CONFIG_VT + /*vt device use only n_tty ldisc*/ + if (tty->ops->ioctl == vt_ioctl) { + if (disc != N_TTY) { + retval = -EINVAL; + goto out; + } + } +#endif + old_ldisc = tty->ldisc; /* Shutdown the old discipline. */