mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
MFC r206395:
Do not leak master pty or ptmx vnode.
This commit is contained in:
parent
305cb06fe3
commit
b754ab83bc
1 changed files with 9 additions and 0 deletions
|
|
@ -589,6 +589,15 @@ ptsdev_close(struct file *fp, struct thread *td)
|
|||
tty_lock(tp);
|
||||
tty_rel_gone(tp);
|
||||
|
||||
/*
|
||||
* Open of /dev/ptmx or /dev/ptyXX changes the type of file
|
||||
* from DTYPE_VNODE to DTYPE_PTS. vn_open() increases vnode
|
||||
* use count, we need to decrement it, and possibly do other
|
||||
* required cleanup.
|
||||
*/
|
||||
if (fp->f_vnode != NULL)
|
||||
return (vnops.fo_close(fp, td));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue