Commit a12b78b5 authored by Ard Biesheuvel's avatar Ard Biesheuvel

efi: libstub: remove pointless goto kludge

Remove some goto cruft that serves no purpose and obfuscates the code.
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent eab31265
...@@ -438,13 +438,14 @@ efi_status_t efi_exit_boot_services(void *handle, void *priv, ...@@ -438,13 +438,14 @@ efi_status_t efi_exit_boot_services(void *handle, void *priv,
efi_status_t status; efi_status_t status;
status = efi_get_memory_map(&map); status = efi_get_memory_map(&map);
if (status != EFI_SUCCESS) if (status != EFI_SUCCESS)
goto fail; return status;
status = priv_func(map, priv); status = priv_func(map, priv);
if (status != EFI_SUCCESS) if (status != EFI_SUCCESS) {
goto free_map; efi_bs_call(free_pool, map);
return status;
}
if (efi_disable_pci_dma) if (efi_disable_pci_dma)
efi_pci_disable_bridge_busmaster(); efi_pci_disable_bridge_busmaster();
...@@ -475,25 +476,16 @@ efi_status_t efi_exit_boot_services(void *handle, void *priv, ...@@ -475,25 +476,16 @@ efi_status_t efi_exit_boot_services(void *handle, void *priv,
/* exit_boot_services() was called, thus cannot free */ /* exit_boot_services() was called, thus cannot free */
if (status != EFI_SUCCESS) if (status != EFI_SUCCESS)
goto fail; return status;
status = priv_func(map, priv); status = priv_func(map, priv);
/* exit_boot_services() was called, thus cannot free */ /* exit_boot_services() was called, thus cannot free */
if (status != EFI_SUCCESS) if (status != EFI_SUCCESS)
goto fail; return status;
status = efi_bs_call(exit_boot_services, handle, map->map_key); status = efi_bs_call(exit_boot_services, handle, map->map_key);
} }
/* exit_boot_services() was called, thus cannot free */
if (status != EFI_SUCCESS)
goto fail;
return EFI_SUCCESS;
free_map:
efi_bs_call(free_pool, map);
fail:
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment