summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>2002-01-03 09:54:24 +0000
committerse <se@FreeBSD.org>2002-01-03 09:54:24 +0000
commit4f45ba2c5347d902dba936428b71423898c3f715 (patch)
treecb2ac5daf924550c55efa966d24bf879c6c8c749 /sys/kern/vfs_extattr.c
parent7a8c144e4630e505b4534e933691d8e9505eafcd (diff)
downloadFreeBSD-src-4f45ba2c5347d902dba936428b71423898c3f715.zip
FreeBSD-src-4f45ba2c5347d902dba936428b71423898c3f715.tar.gz
Return EBADF in case some vnode field has been reset to a NULL pointer.
(There has been some discussion, whether ENOENT or EBADF is more appropriate. I choose the latter, since the operation is not supported on the file descriptor at that time, even if it was, immediately before.) PR: 32681 Reviewed by: dillon, iedowse, ... Approved by: nectar MFC after: 3 days (pending RE approval)
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 696c92e..a54c81a 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -795,6 +795,8 @@ fstatfs(td, uap)
if ((error = getvnode(td->td_proc->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, td);
if (error)
OpenPOWER on IntegriCloud