summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs/devfs_devs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/devfs/devfs_devs.c')
-rw-r--r--sys/fs/devfs/devfs_devs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c
index 5070985..4723a63 100644
--- a/sys/fs/devfs/devfs_devs.c
+++ b/sys/fs/devfs/devfs_devs.c
@@ -304,6 +304,13 @@ devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, struct devfs_dire
void
devfs_dirent_free(struct devfs_dirent *de)
{
+ struct vnode *vp;
+
+ vp = de->de_vnode;
+ mtx_lock(&devfs_de_interlock);
+ if (vp != NULL && vp->v_data == de)
+ vp->v_data = NULL;
+ mtx_unlock(&devfs_de_interlock);
free(de, M_DEVFS3);
}
OpenPOWER on IntegriCloud