From 38c5b3f78814fa7883f4569125acc751c53d2f80 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 16 Jan 2021 12:33:54 +0100 Subject: [PATCH] Kernel: Fix inverted logic in KResultOr This silly inversion has survived so long because we don't exercise the 'unhappy paths' enough. :^) --- Kernel/KResult.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/KResult.h b/Kernel/KResult.h index a261f148935..2629b255513 100644 --- a/Kernel/KResult.h +++ b/Kernel/KResult.h @@ -138,7 +138,7 @@ public: return m_error; } - KResult result() const { return m_is_error ? KSuccess : m_error; } + KResult result() const { return m_is_error ? m_error : KSuccess; } ALWAYS_INLINE T& value() {