Kernel: Don't populate the ACPI SysFS directory with a disabled ACPI

This would cause a nullptr dereference on ACPI::Parser::the().
This commit is contained in:
Idan Horowitz 2022-01-18 10:53:28 +02:00
parent 57ba67ed2a
commit 3945e239e1

View file

@ -22,7 +22,8 @@ UNMAP_AFTER_INIT void FirmwareSysFSDirectory::initialize()
void FirmwareSysFSDirectory::create_components()
{
m_components.append(BIOSSysFSDirectory::must_create(*this));
m_components.append(ACPI::ACPISysFSDirectory::must_create(*this));
if (ACPI::is_enabled())
m_components.append(ACPI::ACPISysFSDirectory::must_create(*this));
m_components.append(PowerStateSwitchNode::must_create(*this));
}