diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-07-29 08:41:14 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-07-29 08:41:14 +0200 |
| commit | eff4dc6b0a9075e640bf8abdb38959d8c408986a (patch) | |
| tree | 177a47d8dc7383e13fe7ad5575f03d712d728dda | |
| parent | 7e382391f32b1133c646a0184e2f426dbfc9f1d9 (diff) | |
| download | kernel-eff4dc6b0a9075e640bf8abdb38959d8c408986a.tar.xz kernel-eff4dc6b0a9075e640bf8abdb38959d8c408986a.zip | |
x86_64: fix use-before-init in cpu bus init
| -rw-r--r-- | arch/x86_64/kapi/devices.cpp | 6 |
1 files 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<arch::bus::cpu>(); + cpu_bus->facet<kapi::devices::bus_protocol>()->enumerate(*cpu_bus); - // cpu_bus = kstd::make_shared<arch::bus::cpu>(); - // cpu_bus->facet<kapi::devices::bus_protocol>()->enumerate(*cpu_bus); + kapi::devices::get_root_bus()->add_child(cpu_bus); } } // namespace kapi::devices
\ No newline at end of file |
