diff options
author | Andreas Kling <kling@serenityos.org> | 2021-12-26 18:12:25 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-26 21:22:59 +0100 |
commit | 9182653a0faa087a5cd8121402fad6c1d3efb353 (patch) | |
tree | 69bf569e1a73c2f7e2670e419703cccaf8e30865 /Kernel | |
parent | c6c786c992de0add4fcb27f9d163fe6c3b1becad (diff) | |
download | serenity-9182653a0faa087a5cd8121402fad6c1d3efb353.zip |
Kernel: Log purported size of bogus kfree_sized() requests
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Heap/kmalloc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp index 8d992d86bf..341a48a1bd 100644 --- a/Kernel/Heap/kmalloc.cpp +++ b/Kernel/Heap/kmalloc.cpp @@ -79,7 +79,7 @@ struct KmallocGlobalData { return allocate(size); } - void deallocate(void* ptr) + void deallocate(void* ptr, size_t size) { VERIFY(!expansion_in_progress); @@ -90,7 +90,7 @@ struct KmallocGlobalData { } } - PANIC("Bogus pointer {:p} passed to kfree()", ptr); + PANIC("Bogus pointer passed to kfree_sized({:p}, {})", ptr, size); } size_t allocated_bytes() const @@ -292,7 +292,7 @@ void kfree_sized(void* ptr, size_t size) PerformanceManager::add_kfree_perf_event(*current_thread, 0, (FlatPtr)ptr); } - g_kmalloc_global->deallocate(ptr); + g_kmalloc_global->deallocate(ptr, size); --g_nested_kfree_calls; } |