diff --git a/Kernel/FileSystem/InodeWatcher.h b/Kernel/FileSystem/InodeWatcher.h index 96fcece63fd..01260b25086 100644 --- a/Kernel/FileSystem/InodeWatcher.h +++ b/Kernel/FileSystem/InodeWatcher.h @@ -26,10 +26,7 @@ struct WatchDescription { static KResultOr> create(int wd, Inode& inode, unsigned event_mask) { - auto description = adopt_own_if_nonnull(new (nothrow) WatchDescription(wd, inode, event_mask)); - if (description) - return description.release_nonnull(); - return ENOMEM; + return adopt_nonnull_own_or_enomem(new (nothrow) WatchDescription(wd, inode, event_mask)); } private: