diff --git a/kernel/kernel/Storage/NVMe/Namespace.cpp b/kernel/kernel/Storage/NVMe/Namespace.cpp index 1c4bbe795b..d371fe66bc 100644 --- a/kernel/kernel/Storage/NVMe/Namespace.cpp +++ b/kernel/kernel/Storage/NVMe/Namespace.cpp @@ -46,15 +46,16 @@ namespace Kernel BAN::ErrorOr NVMeNamespace::initialize() { + BAN::String name_prefix; + TRY(name_prefix.append(m_name)); + TRY(name_prefix.push_back('p')); + m_dma_region = TRY(DMARegion::create(PAGE_SIZE)); add_disk_cache(); DevFileSystem::get().add_device(this); - char name_prefix[20]; - strcpy(name_prefix, m_name); - strcat(name_prefix, "p"); if (auto res = initialize_partitions(name_prefix); res.is_error()) dprintln("{}", res.error());