diff options
author | Andrea Monaco <andrea.monaco@autistici.org> | 2021-11-21 20:23:21 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-11-21 20:23:35 +0100 |
commit | 04983c57ab0fbde06eadd22e6c038a0e7c959fc3 (patch) | |
tree | ddbb254d4c737cd10c01794136cace5cd49c0eb6 /acpi | |
parent | 0cf650f0459def7d1929c5274a71df8630ef96cc (diff) | |
download | hurd-04983c57ab0fbde06eadd22e6c038a0e7c959fc3.tar.gz hurd-04983c57ab0fbde06eadd22e6c038a0e7c959fc3.tar.bz2 hurd-04983c57ab0fbde06eadd22e6c038a0e7c959fc3.zip |
acpi: Factorize code
* acpi/acpi.c (acpi_get_tables): Factorize code.
Diffstat (limited to 'acpi')
-rw-r--r-- | acpi/acpi.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/acpi/acpi.c b/acpi/acpi.c index 94b449a9..8115b2c8 100644 --- a/acpi/acpi.c +++ b/acpi/acpi.c @@ -246,16 +246,13 @@ acpi_get_tables(struct acpi_table **tables) uintptr_t acpi_ptr64 = (uintptr_t)*((uint64_t *)(acpi_ptr + i*sz_ptr)); if (is_64bit) { err = mmap_phys_acpi_header(acpi_ptr64, &next, &virt_addr2, fd_mem); - if (err) { - munmap(virt_addr, ESCD_SIZE); - return err; - } } else { err = mmap_phys_acpi_header(acpi_ptr32, &next, &virt_addr2, fd_mem); - if (err) { - munmap(virt_addr, ESCD_SIZE); - return err; - } + } + + if (err) { + munmap(virt_addr, ESCD_SIZE); + return err; } if (next->signature[0] == '\0' || next->length == 0) { |