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
This commit is contained in:
@@ -58,6 +58,7 @@ acpi_check_rsdt(acpi_rsdp* rsdp)
|
|||||||
|
|
||||||
// Map the whole table, not just the header
|
// Map the whole table, not just the header
|
||||||
uint32 length = rsdt->length;
|
uint32 length = rsdt->length;
|
||||||
|
TRACE(("acpi: rsdt length: %lu\n", length));
|
||||||
mmu_free(rsdt, sizeof(acpi_descriptor_header));
|
mmu_free(rsdt, sizeof(acpi_descriptor_header));
|
||||||
|
|
||||||
sAcpiRsdt = (acpi_descriptor_header*)mmu_map_physical_memory(rsdp->rsdt_address,
|
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",
|
TRACE(("acpi: Looking for '%.4s'. Skipping '%.4s'\n",
|
||||||
signature, header != NULL ? header->signature : "null"));
|
signature, header != NULL ? header->signature : "null"));
|
||||||
|
|
||||||
if (header != NULL)
|
if (header != NULL) {
|
||||||
mmu_free(header, sizeof(acpi_descriptor_header));
|
mmu_free(header, sizeof(acpi_descriptor_header));
|
||||||
|
header = NULL;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user