diff options
author | Liav A <liavalb@gmail.com> | 2022-01-21 11:36:32 +0200 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2022-01-21 19:34:10 +0200 |
commit | d67c70d0435c34a38bb03bc3225c765d81b7136d (patch) | |
tree | 08a24538e731ce6c322814f84a721a03facd3f5d /Kernel/Panic.cpp | |
parent | 0adee378fd0486134bc059cd197ddf2d408328f4 (diff) | |
download | serenity-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.cpp | 2 |
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(); |