diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-07 15:54:23 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-07 15:54:23 +0200 |
commit | 300402cc142aaa4e481801146b47b1d0f72c0647 (patch) | |
tree | 235fc407db0614c3c1b072f6fabed04641f60b5e /Kernel/FileSystem/Inode.cpp | |
parent | be613b9ef6ceea86aa511d4f411c8638b52e9d22 (diff) | |
download | serenity-300402cc142aaa4e481801146b47b1d0f72c0647.zip |
Kernel: Make it possible for KBufferBuilder creation to fail
This patch adds KBufferBuilder::try_create() and treats it like anything
else that can fail. And so, failure to allocate the initial internal
buffer of the builder will now propagate an ENOMEM to the caller. :^)
Diffstat (limited to 'Kernel/FileSystem/Inode.cpp')
-rw-r--r-- | Kernel/FileSystem/Inode.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/Inode.cpp b/Kernel/FileSystem/Inode.cpp index b301745df4..a83b41d6e3 100644 --- a/Kernel/FileSystem/Inode.cpp +++ b/Kernel/FileSystem/Inode.cpp @@ -47,7 +47,7 @@ void Inode::sync() KResultOr<NonnullOwnPtr<KBuffer>> Inode::read_entire(OpenFileDescription* description) const { - KBufferBuilder builder; + auto builder = TRY(KBufferBuilder::try_create()); u8 buffer[4096]; off_t offset = 0; |