devfs: fix use count leak when using TIOCSCTTY

by matching devfs_ctty_ref

Fixes: 3b44443626 ("devfs: rework si_usecount to track opens")
This commit is contained in:
Mateusz Guzik 2021-02-08 23:10:57 +01:00
parent 57785538c6
commit 3bc17248d3

View File

@ -974,7 +974,7 @@ devfs_ioctl(struct vop_ioctl_args *ap)
/* Get rid of reference to old control tty */
if (vpold)
vrele(vpold);
devfs_ctty_unref(vpold);
}
return (error);
}