git: 23c33a97729d - stable/15 - devfs_open: do not access dsw after dev_relthread()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 12 Oct 2026 02:21:32 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=23c33a97729d9dcb3b8580547d7f461368f597d7
commit 23c33a97729d9dcb3b8580547d7f461368f597d7
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-10-05 23:35:32 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-10-12 02:20:49 +0000
devfs_open: do not access dsw after dev_relthread()
(cherry picked from commit 1e595e959f66e11d0490e90270b9fb701cbc6739)
---
sys/fs/devfs/devfs_vnops.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index 038dfb34166e..2a6f463701e1 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -1288,6 +1288,7 @@ devfs_open(struct vop_open_args *ap)
int error, ref, vlocked;
struct cdevsw *dsw;
struct file *fpop;
+ bool passable;
if (vp->v_type == VBLK)
return (ENXIO);
@@ -1306,6 +1307,7 @@ devfs_open(struct vop_open_args *ap)
dev_relthread(dev, ref);
return (ENXIO);
}
+ passable = (dsw->d_flags & D_NONPASSABLE) == 0;
if (vp->v_type == VCHR)
devfs_usecount_add(vp);
@@ -1347,8 +1349,7 @@ devfs_open(struct vop_open_args *ap)
#endif
if (fp->f_ops == &badfileops) {
finit(fp, fp->f_flag, DTYPE_VNODE, dev,
- (dsw->d_flags & D_NONPASSABLE) == 0 ? &devfs_ops_f :
- &devfs_ops_nonpassable_f);
+ passable ? &devfs_ops_f : &devfs_ops_nonpassable_f);
}
return (error);
}