svn commit: r329421 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Sat Feb 17 00:23:57 UTC 2018


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


More information about the svn-src-all mailing list