mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
acpi: Unmap RSDP in more error cases
Add missing pmap_unmapbios() calls for when we return 0. Otherwise we can leave the table mapped when it is of no use. Sponsored by: Netflix Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D36405
This commit is contained in:
parent
195f794318
commit
a14b26a6bd
@ -203,12 +203,16 @@ acpi_find_table(const char *sig)
|
||||
if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) {
|
||||
if (bootverbose)
|
||||
printf("ACPI: RSDP failed extended checksum\n");
|
||||
pmap_unmapbios((vm_offset_t)rsdp,
|
||||
sizeof(ACPI_TABLE_RSDP));
|
||||
return (0);
|
||||
}
|
||||
xsdt = map_table(rsdp->XsdtPhysicalAddress, ACPI_SIG_XSDT);
|
||||
if (xsdt == NULL) {
|
||||
if (bootverbose)
|
||||
printf("ACPI: Failed to map XSDT\n");
|
||||
pmap_unmapbios((vm_offset_t)rsdp,
|
||||
sizeof(ACPI_TABLE_RSDP));
|
||||
return (0);
|
||||
}
|
||||
count = (xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) /
|
||||
@ -224,6 +228,8 @@ acpi_find_table(const char *sig)
|
||||
if (rsdt == NULL) {
|
||||
if (bootverbose)
|
||||
printf("ACPI: Failed to map RSDT\n");
|
||||
pmap_unmapbios((vm_offset_t)rsdp,
|
||||
sizeof(ACPI_TABLE_RSDP));
|
||||
return (0);
|
||||
}
|
||||
count = (rsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) /
|
||||
|
@ -176,6 +176,8 @@ acpi_find_table(const char *sig)
|
||||
if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) {
|
||||
if (bootverbose)
|
||||
printf("ACPI: RSDP failed extended checksum\n");
|
||||
pmap_unmapbios((vm_offset_t)rsdp,
|
||||
sizeof(ACPI_TABLE_RSDP));
|
||||
return (0);
|
||||
}
|
||||
xsdt = map_table(rsdp->XsdtPhysicalAddress, ACPI_SIG_XSDT);
|
||||
|
Loading…
Reference in New Issue
Block a user