summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-25 23:18:11 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-25 23:18:11 +0200
commit1163e0a030be34188e93a72aa6f110f7963e4877 (patch)
treef733ce91a43c93299de2b2af8b9c7641ec7e8b53
parent96d4b701e626c735cea447b5b0664d1b420a00fb (diff)
downloadserenity-1163e0a030be34188e93a72aa6f110f7963e4877.zip
Kernel: Don't count kfree(nullptr) as a call to kfree().
This was causing the kmalloc/kfree call delta to accumulate errors.
-rw-r--r--Kernel/kmalloc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/kmalloc.cpp b/Kernel/kmalloc.cpp
index 0312fa7db9..af65f5f341 100644
--- a/Kernel/kmalloc.cpp
+++ b/Kernel/kmalloc.cpp
@@ -166,11 +166,11 @@ void* kmalloc_impl(size_t size)
void kfree(void *ptr)
{
- ++g_kfree_call_count;
if (!ptr)
return;
InterruptDisabler disabler;
+ ++g_kfree_call_count;
auto* a = (allocation_t*)((((byte*)ptr) - sizeof(allocation_t)));