Dispose the kernel stack of the proper thread.

Submitted by:	alc
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2009-08-29 18:01:02 +00:00
parent cbc3c1f687
commit b6b2d1bf88

View File

@ -292,7 +292,7 @@ fork1(td, flags, pages, procp)
} else {
if (td2->td_kstack == 0 || td2->td_kstack_pages != pages) {
if (td2->td_kstack != 0)
vm_thread_dispose(td);
vm_thread_dispose(td2);
if (!thread_alloc_stack(td2, pages)) {
error = ENOMEM;
goto fail1;