summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_racct.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2011-10-03 15:32:15 +0000
committertrasz <trasz@FreeBSD.org>2011-10-03 15:32:15 +0000
commit138a535460213399389b2c4da12e1d65b6061ef3 (patch)
tree8a669d23b374f5ff7f28612a893cd6044b3b0075 /sys/kern/kern_racct.c
parent190bd9f0974ec538cdc498f5b910c06455f3df6e (diff)
downloadFreeBSD-src-138a535460213399389b2c4da12e1d65b6061ef3.zip
FreeBSD-src-138a535460213399389b2c4da12e1d65b6061ef3.tar.gz
Fix bug introduced in r225641, which would cause panic if racct_proc_fork()
returned error -- the racct_destroy_locked() would get called twice. MFC after: 3 days
Diffstat (limited to 'sys/kern/kern_racct.c')
-rw-r--r--sys/kern/kern_racct.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
index b12b7c7..525866c 100644
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -569,32 +569,15 @@ racct_proc_fork(struct proc *parent, struct proc *child)
error = racct_set_locked(child, i,
parent->p_racct->r_resources[i]);
- if (error != 0) {
- /*
- * XXX: The only purpose of these two lines is
- * to prevent from tripping checks in racct_destroy().
- */
- for (i = 0; i <= RACCT_MAX; i++)
- racct_set_locked(child, i, 0);
+ if (error != 0)
goto out;
- }
}
#ifdef RCTL
error = rctl_proc_fork(parent, child);
- if (error != 0) {
- /*
- * XXX: The only purpose of these two lines is to prevent from
- * tripping checks in racct_destroy().
- */
- for (i = 0; i <= RACCT_MAX; i++)
- racct_set_locked(child, i, 0);
- }
#endif
out:
- if (error != 0)
- racct_destroy_locked(&child->p_racct);
mtx_unlock(&racct_lock);
PROC_UNLOCK(child);
PROC_UNLOCK(parent);
OpenPOWER on IntegriCloud