]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/uipc_usrreq.c
xnu-201.19.tar.gz
[apple/xnu.git] / bsd / kern / uipc_usrreq.c
index 35f27aa4fe4f47c49c9a31d58ecb4f75dbeb8f2a..459a67a057ca89ef8c31e564aae71e5ec8420e8a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2001 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -524,11 +524,12 @@ unp_detach(unp)
        unp->unp_gencnt = ++unp_gencnt;
        --unp_count;
        if (unp->unp_vnode) {
+               struct vnode *tvp = unp->unp_vnode;
                unp->unp_vnode->v_socket = 0;
+               unp->unp_vnode = 0;
                thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
-               vrele(unp->unp_vnode);
+               vrele(tvp);
                thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
-               unp->unp_vnode = 0;
        }
        if (unp->unp_conn)
                unp_disconnect(unp);