diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index c23938b8628d1228e3a3182d71154a9dbe6eff77..94aa39cde22ea900dbacddfa9c382383cf22bba2 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -579,6 +579,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. */