From 0a5312730c7cfb41c2da26dcd9d83b78de63fd27 Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 13 Aug 2021 19:20:32 +0300 Subject: [PATCH] Kernel/ProcFS: Propagate errors correctly when they occur Calling error() on KResult is a mistake I made in 7ba991dc371, so instead of doing that, which triggers an assertion if an error occured, in Inode::read_entire method with VERIFY(nread <= sizeof(buffer)), we really should just return the KResult and not to call error() on it. --- Kernel/FileSystem/ProcFS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index 0f4f098f17d..2a6e7c64e91 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -486,7 +486,7 @@ KResultOr ProcFSProcessPropertyInode::read_bytes(off_t offset, size_t co if (!process) return KResult(ESRCH); if (auto result = try_to_acquire_data(*process, builder); result.is_error()) - return result.error(); + return result; auto data_buffer = builder.build(); if (!data_buffer) return KResult(EFAULT);