1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

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.
This commit is contained in:
Liav A 2021-09-10 18:06:26 +03:00 committed by Andreas Kling
parent 026f80a95b
commit d0245b5e6b

View file

@ -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