diff options
author | Luke <luke.wilde@live.co.uk> | 2020-09-16 18:47:47 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-16 20:38:19 +0200 |
commit | 68b361bd21bcf7d44dd2fe8d40f4059041b08966 (patch) | |
tree | fe4e6b8decb755197d7eab198240e802b34ca5cc /Kernel/Thread.h | |
parent | 2229b13c974015426cb7889d8ea311e5757099cb (diff) | |
download | serenity-68b361bd21bcf7d44dd2fe8d40f4059041b08966.zip |
Kernel: Return ENOMEM in more places
There are plenty of places in the kernel that aren't
checking if they actually got their allocation.
This fixes some of them, but definitely not all.
Fixes #3390
Fixes #3391
Also, let's make find_one_free_page() return nullptr
if it doesn't get a free index. This stops the kernel
crashing when out of memory and allows memory purging
to take place again.
Fixes #3487
Diffstat (limited to 'Kernel/Thread.h')
-rw-r--r-- | Kernel/Thread.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 5e766643d6..e997c344bf 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -433,9 +433,9 @@ public: void set_default_signal_dispositions(); bool push_value_on_stack(FlatPtr); - u32 make_userspace_stack_for_main_thread(Vector<String> arguments, Vector<String> environment, Vector<AuxiliaryValue>); + KResultOr<u32> make_userspace_stack_for_main_thread(Vector<String> arguments, Vector<String> environment, Vector<AuxiliaryValue>); - void make_thread_specific_region(Badge<Process>); + KResult make_thread_specific_region(Badge<Process>); unsigned syscall_count() const { return m_syscall_count; } void did_syscall() { ++m_syscall_count; } |