diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-02-28 15:57:33 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-02-28 15:57:33 +0000 |
commit | c2b425f8b522fd3591f0b90e957a9910cd47ce57 (patch) | |
tree | 38bc2a7048d13709fd5014bf6daf2b4c8e791d44 /sys/kern/kern_thread.c | |
parent | bd0614a3d10b14d07ead70b46bed8f44857ff970 (diff) | |
download | FreeBSD-src-c2b425f8b522fd3591f0b90e957a9910cd47ce57.zip FreeBSD-src-c2b425f8b522fd3591f0b90e957a9910cd47ce57.tar.gz |
Check kse group limit before linking new ksegrp.
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r-- | sys/kern/kern_thread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 01c1614..4c692e5 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.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; |