aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_kse.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2003-02-28 15:57:33 +0000
committerDavid Xu <davidxu@FreeBSD.org>2003-02-28 15:57:33 +0000
commit9948c47f0efd7b4bc4647d9ce9f01a6ce9a78864 (patch)
tree38bc2a7048d13709fd5014bf6daf2b4c8e791d44 /sys/kern/kern_kse.c
parent01ba618f4a329f47b71ac6db961beab89f6da538 (diff)
downloadsrc-9948c47f0efd7b4bc4647d9ce9f01a6ce9a78864.tar.gz
src-9948c47f0efd7b4bc4647d9ce9f01a6ce9a78864.zip
Check kse group limit before linking new ksegrp.
Notes
Notes: svn path=/head/; revision=111677
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r--sys/kern/kern_kse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 01c1614aca8d..4c692e5eda7b 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -626,12 +626,12 @@ kse_create(struct thread *td, struct kse_create_args *uap)
bcopy(&kg->kg_startcopy, &newkg->kg_startcopy,
RANGEOF(struct ksegrp, kg_startcopy, kg_endcopy));
mtx_lock_spin(&sched_lock);
- ksegrp_link(newkg, p);
if (p->p_numksegrps >= max_groups_per_proc) {
- ksegrp_unlink(newkg);
mtx_unlock_spin(&sched_lock);
+ ksegrp_free(newkg);
return (EPROCLIM);
}
+ ksegrp_link(newkg, p);
mtx_unlock_spin(&sched_lock);
} else {
newkg = kg;