aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-02-08 22:10:57 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-02-09 01:54:21 +0000
commit3bc17248d31794519ba95b2c6b9ff8a0d31dba81 (patch)
treeeaff298e4a634d8a9e37b74019e006149859ff8a
parent57785538c6e0d7e8ca0f161ab95bae10fd304047 (diff)
downloadsrc-3bc17248d31794519ba95b2c6b9ff8a0d31dba81.tar.gz
src-3bc17248d31794519ba95b2c6b9ff8a0d31dba81.zip
devfs: fix use count leak when using TIOCSCTTY
by matching devfs_ctty_ref Fixes: 3b44443626603f65 ("devfs: rework si_usecount to track opens")
-rw-r--r--sys/fs/devfs/devfs_vnops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index 983bfc803999..043cee74fde2 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -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);
}