aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsserver/nfs_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/nfsserver/nfs_syscalls.c')
-rw-r--r--sys/nfsserver/nfs_syscalls.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c
index 17f90f783fc79..73935f83e9bdf 100644
--- a/sys/nfsserver/nfs_syscalls.c
+++ b/sys/nfsserver/nfs_syscalls.c
@@ -143,9 +143,12 @@ nfssvc(struct thread *td, struct nfssvc_args *uap)
error = copyin(uap->argp, (caddr_t)&nfsdarg, sizeof(nfsdarg));
if (error)
goto done2;
- error = holdsock(td->td_proc->p_fd, nfsdarg.sock, &fp);
- if (error)
+ if ((error = fget(td, nfsdarg.sock, &fp)) != 0)
+ goto done2;
+ if (fp->f_type != DTYPE_SOCKET) {
+ fdrop(fp, td);
goto done2;
+ }
/*
* Get the client address for connected sockets.
*/