summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-18 10:53:28 +0200
committerIdan Horowitz <idan.horowitz@gmail.com>2022-01-18 21:00:46 +0200
commit3945e239e1108a9f72f1bda141198bb97b485ade (patch)
tree57dbe19a83bfadac91bb9ae31288dd6c908e98e9
parent57ba67ed2a7d5055a2bf8d65183b8c62f355d83d (diff)
downloadserenity-3945e239e1108a9f72f1bda141198bb97b485ade.zip
Kernel: Don't populate the ACPI SysFS directory with a disabled ACPI
This would cause a nullptr dereference on ACPI::Parser::the().
-rw-r--r--Kernel/Firmware/SysFSFirmware.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Firmware/SysFSFirmware.cpp b/Kernel/Firmware/SysFSFirmware.cpp
index e1f6c084be..b0ee02e562 100644
--- a/Kernel/Firmware/SysFSFirmware.cpp
+++ b/Kernel/Firmware/SysFSFirmware.cpp
@@ -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));
}