summaryrefslogtreecommitdiff
path: root/Kernel/Bus
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Bus')
-rw-r--r--Kernel/Bus/PCI/Access.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Kernel/Bus/PCI/Access.cpp b/Kernel/Bus/PCI/Access.cpp
index 0959bed47d..d7a837b66a 100644
--- a/Kernel/Bus/PCI/Access.cpp
+++ b/Kernel/Bus/PCI/Access.cpp
@@ -42,7 +42,12 @@ UNMAP_AFTER_INIT bool Access::find_and_register_pci_host_bridges_from_acpi_mcfg_
u32 length = 0;
u8 revision = 0;
{
- auto mapped_mcfg_table = Memory::map_typed<ACPI::Structures::SDTHeader>(mcfg_table);
+ auto mapped_mcfg_table_or_error = Memory::map_typed<ACPI::Structures::SDTHeader>(mcfg_table);
+ if (mapped_mcfg_table_or_error.is_error()) {
+ dbgln("Failed to map MCFG table");
+ return false;
+ }
+ auto mapped_mcfg_table = mapped_mcfg_table_or_error.release_value();
length = mapped_mcfg_table->length;
revision = mapped_mcfg_table->revision;
}