mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
Do not leak master pty or ptmx vnode.
Report and test case by: Petr Salinger <Petr.Salinger seznam cz> Reviewed by: ed MFC after: 1 week
This commit is contained in:
parent
500e8f26d7
commit
6d51747362
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=206395
@ -575,6 +575,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 New Issue
Block a user