1
0
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:
Warner Losh 2022-09-01 10:39:20 -06:00
parent 195f794318
commit a14b26a6bd
2 changed files with 8 additions and 0 deletions

View File

@ -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)) /

View File

@ -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);