svn commit: r184217 - head/sys/kern

David Xu davidxu at FreeBSD.org
Fri Oct 24 01:09:25 UTC 2008


Author: davidxu
Date: Fri Oct 24 01:09:24 2008
New Revision: 184217
URL: http://svn.freebsd.org/changeset/base/184217

Log:
  Don't rearm callout if the process is exiting, it may leak a callout
  because callout_drain() only waits for running callout, but not disable
  it if it is rearmed.

Modified:
  head/sys/kern/kern_resource.c

Modified: head/sys/kern/kern_resource.c
==============================================================================
--- head/sys/kern/kern_resource.c	Fri Oct 24 01:03:31 2008	(r184216)
+++ head/sys/kern/kern_resource.c	Fri Oct 24 01:09:24 2008	(r184217)
@@ -638,7 +638,8 @@ lim_cb(void *arg)
 			psignal(p, SIGXCPU);
 		}
 	}
-	callout_reset(&p->p_limco, hz, lim_cb, p);
+	if ((p->p_flag & P_WEXIT) == 0)
+		callout_reset(&p->p_limco, hz, lim_cb, p);
 }
 
 int


More information about the svn-src-all mailing list