diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 37a3126fbe10..86720776e207 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -143,12 +143,13 @@ ptyinit(dev_t devc) struct pt_ioctl *pt; int n; - devc->si_flags &= ~SI_CHEAPCLONE; n = minor(devc); /* For now we only map the lower 8 bits of the minor */ if (n & ~0xff) return (NODEV); + devc->si_flags &= ~SI_CHEAPCLONE; + pt = malloc(sizeof(*pt), M_PTY, M_WAITOK | M_ZERO); pt->devs = devs = make_dev(&pts_cdevsw, n, UID_ROOT, GID_WHEEL, 0666, "tty%c%r", names[n / 32], n % 32);