aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index d4b7ac71eb97..181d0004e940 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -6300,6 +6300,7 @@ vfs_emptydir(struct vnode *vp)
eof = 0;
ASSERT_VOP_LOCKED(vp, "vfs_emptydir");
+ VNASSERT(vp->v_type == VDIR, vp, ("vp is not a directory"));
dirent = malloc(sizeof(struct dirent), M_TEMP, M_WAITOK);
iov.iov_base = dirent;