Commit e7ea37b0 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Ard Biesheuvel

efi/libstub: Simplify efi_get_memory_map()

Do not check the value of status twice.
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Link: https://lore.kernel.org/r/20200216184050.3100-1-xypron.glpk@gmx.deSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent eaa6fc67
......@@ -52,13 +52,14 @@ efi_status_t efi_get_memory_map(struct efi_boot_memmap *map)
goto again;
}
if (status != EFI_SUCCESS)
efi_bs_call(free_pool, m);
if (map->key_ptr && status == EFI_SUCCESS)
if (status == EFI_SUCCESS) {
if (map->key_ptr)
*map->key_ptr = key;
if (map->desc_ver && status == EFI_SUCCESS)
if (map->desc_ver)
*map->desc_ver = desc_version;
} else {
efi_bs_call(free_pool, m);
}
fail:
*map->map = m;
......
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