summaryrefslogtreecommitdiff
path: root/Kernel/Panic.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-01-21 11:36:32 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-21 19:34:10 +0200
commitd67c70d0435c34a38bb03bc3225c765d81b7136d (patch)
tree08a24538e731ce6c322814f84a721a03facd3f5d /Kernel/Panic.cpp
parent0adee378fd0486134bc059cd197ddf2d408328f4 (diff)
downloadserenity-d67c70d0435c34a38bb03bc3225c765d81b7136d.zip
Kernel: Ensure that CommandLine is initialized before choosing PanicMode
If the kernel commandline is not initialized, just halt everything.
Diffstat (limited to 'Kernel/Panic.cpp')
-rw-r--r--Kernel/Panic.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Panic.cpp b/Kernel/Panic.cpp
index c2022d8486..34100a1bdb 100644
--- a/Kernel/Panic.cpp
+++ b/Kernel/Panic.cpp
@@ -33,6 +33,8 @@ void __panic(const char* file, unsigned int line, const char* function)
critical_dmesgln("at {}:{} in {}", file, line, function);
dump_backtrace(PrintToScreen::Yes);
+ if (!CommandLine::was_initialized())
+ Processor::halt();
switch (kernel_command_line().panic_mode()) {
case PanicMode::Shutdown:
__shutdown();