From eff4dc6b0a9075e640bf8abdb38959d8c408986a Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 29 Jul 2026 08:41:14 +0200 Subject: x86_64: fix use-before-init in cpu bus init --- arch/x86_64/kapi/devices.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86_64/kapi/devices.cpp b/arch/x86_64/kapi/devices.cpp index eb84bc1f..d9a0b2b9 100644 --- a/arch/x86_64/kapi/devices.cpp +++ b/arch/x86_64/kapi/devices.cpp @@ -44,10 +44,10 @@ namespace kapi::devices system::panic("[x86_64:DEV] The CPU topology has already been initialized!"); } - kapi::devices::get_root_bus()->add_child(cpu_bus); + cpu_bus = kstd::make_shared(); + cpu_bus->facet()->enumerate(*cpu_bus); - // cpu_bus = kstd::make_shared(); - // cpu_bus->facet()->enumerate(*cpu_bus); + kapi::devices::get_root_bus()->add_child(cpu_bus); } } // namespace kapi::devices \ No newline at end of file -- cgit v1.2.3