kernel/user_mutex: Panic instead of failing due to OOM.

This is not an expected failure condition for most applications,
so try to avoid propagating it to userspace.

(If necessary, it should be possible to avoid even the possibility
of this by just allocating necessary datastructures upfront
instead of "lazily". But that seems unnecessary at the moment.)
This commit is contained in:
Augustin Cavalier
2026-03-02 19:38:26 -05:00
parent ae70142168
commit f9850b561c
+4 -1
View File
@@ -284,8 +284,10 @@ get_user_mutex_entry(struct user_mutex_context* context,
}
entry = new(std::nothrow) UserMutexEntry;
if (entry == NULL)
if (entry == NULL) {
panic("UserMutexEntry allocation failed!");
return entry;
}
entry->address = address;
entry->ref_count = 1;
@@ -469,6 +471,7 @@ struct UserMutexContextFetcher {
if (!fShared) {
fContext = get_team_user_mutex_context();
if (fContext == NULL) {
panic("UserMutexContext allocation failed!");
fInitStatus = B_NO_MEMORY;
return;
}