diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c index b6a2275c51b..d7bef81620e 100644 --- a/sys/kern/kern_kse.c +++ b/sys/kern/kern_kse.c @@ -436,9 +436,7 @@ thread_userret(struct proc *p, struct ksegrp *kg, struct kse *ke, int error = 0; if (ke->ke_tdspare == NULL) { - mtx_lock(&Giant); ke->ke_tdspare = thread_alloc(); - mtx_unlock(&Giant); } if (td->td_flags & TDF_UNBOUND) { /* diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index b6a2275c51b..d7bef81620e 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -436,9 +436,7 @@ thread_userret(struct proc *p, struct ksegrp *kg, struct kse *ke, int error = 0; if (ke->ke_tdspare == NULL) { - mtx_lock(&Giant); ke->ke_tdspare = thread_alloc(); - mtx_unlock(&Giant); } if (td->td_flags & TDF_UNBOUND) { /*