aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_syscalls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index de2e4861e9ed..6bbd90fc8a63 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -678,6 +678,8 @@ fstatfs(p, uap)
if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0)
return (error);
mp = ((struct vnode *)fp->f_data)->v_mount;
+ if (mp == NULL)
+ return (EBADF);
sp = &mp->mnt_stat;
error = VFS_STATFS(mp, sp, p);
if (error)