summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Syscalls/thread.cpp')
-rw-r--r--Kernel/Syscalls/thread.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/Syscalls/thread.cpp b/Kernel/Syscalls/thread.cpp
index 1f13f90ce3..ca7db7b4d4 100644
--- a/Kernel/Syscalls/thread.cpp
+++ b/Kernel/Syscalls/thread.cpp
@@ -79,7 +79,9 @@ int Process::sys$create_thread(void* (*entry)(void*), Userspace<const Syscall::S
tss.cr3 = page_directory().cr3();
tss.esp = (u32)user_stack_address;
- thread->make_thread_specific_region({});
+ auto tsr_result = thread->make_thread_specific_region({});
+ if (tsr_result.is_error())
+ return tsr_result.error();
thread->set_state(Thread::State::Runnable);
return thread->tid().value();
}