summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2009-06-17 22:50:26 +0000
committerrmacklem <rmacklem@FreeBSD.org>2009-06-17 22:50:26 +0000
commitd88296a89fa7b699f237de7a86e30ce4995a2a4f (patch)
tree16d38ade3aac3d505cfcf872a12639bc87a462cc /sys/nfsserver
parent8f12a6bcc5ea67ea87483b297472861ac8058429 (diff)
downloadFreeBSD-src-d88296a89fa7b699f237de7a86e30ce4995a2a4f.zip
FreeBSD-src-d88296a89fa7b699f237de7a86e30ce4995a2a4f.tar.gz
Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the
SVCXPTR structure returned by them, it was possible for the structure to be free'd before svc_reg() had been completed using the structure. This patch acquires a reference count on the newly created structure that is returned by svc_[dg|vc|tli|tp]_create(). It also adds the appropriate SVC_RELEASE() calls to the callers, except the experimental nfs subsystem. The latter will be committed separately. Submitted by: dfr Tested by: pho Approved by: kib (mentor)
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_srvkrpc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/nfsserver/nfs_srvkrpc.c b/sys/nfsserver/nfs_srvkrpc.c
index 6fe28aa..99edac5 100644
--- a/sys/nfsserver/nfs_srvkrpc.c
+++ b/sys/nfsserver/nfs_srvkrpc.c
@@ -467,6 +467,7 @@ nfssvc_addsock(struct file *fp, struct thread *td)
fp->f_data = NULL;
svc_reg(xprt, NFS_PROG, NFS_VER2, nfssvc_program, NULL);
svc_reg(xprt, NFS_PROG, NFS_VER3, nfssvc_program, NULL);
+ SVC_RELEASE(xprt);
}
return (0);
OpenPOWER on IntegriCloud