1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

Kernel: Make InodeWatcher::crate API OOM safe

This commit is contained in:
Brian Gianforcaro 2021-05-13 04:31:27 -07:00 committed by Andreas Kling
parent c8758d4faa
commit 0d50d3ed1e
3 changed files with 21 additions and 7 deletions

View file

@ -21,7 +21,11 @@ KResultOr<int> Process::sys$create_inode_watcher(u32 flags)
if (fd < 0)
return fd;
auto description_or_error = FileDescription::create(*InodeWatcher::create());
auto watcher_or_error = InodeWatcher::create();
if (watcher_or_error.is_error())
return watcher_or_error.error();
auto description_or_error = FileDescription::create(*watcher_or_error.value());
if (description_or_error.is_error())
return description_or_error.error();