Author: mjg
Date: Sat Feb 17 00:23:56 2018
New Revision: 329421
URL: https://svnweb.freebsd.org/changeset/base/329421

Log:
  Unref the prison after proctree is dropped.

Modified:
  head/sys/kern/kern_exit.c

Modified: head/sys/kern/kern_exit.c
==============================================================================
--- head/sys/kern/kern_exit.c   Sat Feb 17 00:23:28 2018        (r329420)
+++ head/sys/kern/kern_exit.c   Sat Feb 17 00:23:56 2018        (r329421)
@@ -530,9 +530,6 @@ exit1(struct thread *td, int rval, int signo)
        PROC_LOCK(p);
        p->p_xthread = td;
 
-       /* Tell the prison that we are gone. */
-       prison_proc_free(p->p_ucred->cr_prison);
-
 #ifdef KDTRACE_HOOKS
        /*
         * Tell the DTrace fasttrap provider about the exit if it
@@ -602,6 +599,9 @@ exit1(struct thread *td, int rval, int signo)
        } else
                PROC_LOCK(p->p_pptr);
        sx_xunlock(&proctree_lock);
+
+       /* Tell the prison that we are gone. */
+       prison_proc_free(p->p_ucred->cr_prison);
 
        /*
         * The state PRS_ZOMBIE prevents other proesses from sending
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to