From 6e70e32dec85f4b242e64a2edb629472ad781a46 Mon Sep 17 00:00:00 2001 From: anevilyak Date: Sat, 11 Jun 2011 18:38:15 +0000 Subject: [PATCH] If we found a header, but it wasn't the one we were looking for, reset the header ptr to NULL after unmapping. Otherwise a bogus header pointer was potentially returned, leading to an invalid mem access. Fixes boot problems on my Athlon following recent ACPI changes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42103 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/bios_ia32/acpi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system/boot/platform/bios_ia32/acpi.cpp b/src/system/boot/platform/bios_ia32/acpi.cpp index a38387438c..7c5409854d 100644 --- a/src/system/boot/platform/bios_ia32/acpi.cpp +++ b/src/system/boot/platform/bios_ia32/acpi.cpp @@ -58,6 +58,7 @@ acpi_check_rsdt(acpi_rsdp* rsdp) // Map the whole table, not just the header uint32 length = rsdt->length; + TRACE(("acpi: rsdt length: %lu\n", length)); mmu_free(rsdt, sizeof(acpi_descriptor_header)); sAcpiRsdt = (acpi_descriptor_header*)mmu_map_physical_memory(rsdp->rsdt_address, @@ -100,9 +101,10 @@ acpi_find_table(const char* signature) TRACE(("acpi: Looking for '%.4s'. Skipping '%.4s'\n", signature, header != NULL ? header->signature : "null")); - if (header != NULL) + if (header != NULL) { mmu_free(header, sizeof(acpi_descriptor_header)); - + header = NULL; + } continue; }