diff options
author | Liav A <liavalb@gmail.com> | 2021-09-10 18:06:26 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-10 22:01:23 +0200 |
commit | d0245b5e6b9428ef735e17ce8e8060b81153092f (patch) | |
tree | a27fce5e0682150dcc7c660e82c03f006c0570c0 /Kernel | |
parent | 026f80a95bb28e9d692fc44203c5a9b1336ce394 (diff) | |
download | serenity-d0245b5e6b9428ef735e17ce8e8060b81153092f.zip |
Kernel/CommandLine: Verify ACPI feature level cannot have invalid string
The allowed options are "on", "limited" and "off". Anything else is now
not allowed and will result in kernel panic.
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/CommandLine.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/CommandLine.cpp b/Kernel/CommandLine.cpp index 154311450a..061fa5d093 100644 --- a/Kernel/CommandLine.cpp +++ b/Kernel/CommandLine.cpp @@ -142,7 +142,9 @@ UNMAP_AFTER_INIT AcpiFeatureLevel CommandLine::acpi_feature_level() const return AcpiFeatureLevel::Limited; if (value == "off"sv) return AcpiFeatureLevel::Disabled; - return AcpiFeatureLevel::Enabled; + if (value == "on"sv) + return AcpiFeatureLevel::Enabled; + PANIC("Unknown ACPI feature level: {}", value); } UNMAP_AFTER_INIT HPETMode CommandLine::hpet_mode() const |