summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-11-29 02:59:08 -0800
committerAndreas Kling <kling@serenityos.org>2021-11-30 11:16:35 +0100
commita0e59099fcbd4f22f081928f6f47849ee7b7842d (patch)
treef3b3e4896573c99397a088bfb55c7a8ca70f87bd
parenta5cec06135be8415545765785a45227839ef2018 (diff)
downloadserenity-a0e59099fcbd4f22f081928f6f47849ee7b7842d.zip
Kernel: Handle string format errors in KCOVInstance :^)
-rw-r--r--Kernel/Devices/KCOVInstance.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Devices/KCOVInstance.cpp b/Kernel/Devices/KCOVInstance.cpp
index 9286675ee7..b4fc741a4d 100644
--- a/Kernel/Devices/KCOVInstance.cpp
+++ b/Kernel/Devices/KCOVInstance.cpp
@@ -29,8 +29,9 @@ ErrorOr<void> KCOVInstance::buffer_allocate(size_t buffer_size_in_entries)
// backed by the same vmobject
m_vmobject = TRY(Memory::AnonymousVMObject::try_create_with_size(m_buffer_size_in_bytes, AllocationStrategy::AllocateNow));
+ auto region_name = TRY(KString::formatted("kcov_{}", m_pid));
m_kernel_region = TRY(MM.allocate_kernel_region_with_vmobject(
- *m_vmobject, m_buffer_size_in_bytes, String::formatted("kcov_{}", m_pid),
+ *m_vmobject, m_buffer_size_in_bytes, region_name->view(),
Memory::Region::Access::ReadWrite));
m_buffer = (u64*)m_kernel_region->vaddr().as_ptr();