From d158f2ed896abd46e8df2c1dc9ba41413bc87e6e Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sat, 11 Sep 2021 09:51:43 -0700 Subject: [PATCH] Kernel: Zero initialize SlabAllocator member variables PVS-Studio flagged these as uninitialized. While there is no bug here, it is our policy to always initialize members to avoid potential bugs in the future. --- Kernel/Heap/SlabAllocator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Heap/SlabAllocator.cpp b/Kernel/Heap/SlabAllocator.cpp index 9a74e8c17c..179cdcc0b8 100644 --- a/Kernel/Heap/SlabAllocator.cpp +++ b/Kernel/Heap/SlabAllocator.cpp @@ -97,8 +97,8 @@ private: }; Atomic m_freelist { nullptr }; - Atomic m_num_allocated; - size_t m_slab_count; + Atomic m_num_allocated { 0 }; + size_t m_slab_count { 0 }; void* m_base { nullptr }; void* m_end { nullptr };