提交 e7ea37b0 编写于 作者: H Heinrich Schuchardt 提交者: Ard Biesheuvel

efi/libstub: Simplify efi_get_memory_map()

Do not check the value of status twice.
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Link: https://lore.kernel.org/r/20200216184050.3100-1-xypron.glpk@gmx.deSigned-off-by: NArd Biesheuvel <ardb@kernel.org>
上级 eaa6fc67
......@@ -52,13 +52,14 @@ efi_status_t efi_get_memory_map(struct efi_boot_memmap *map)
goto again;
}
if (status != EFI_SUCCESS)
if (status == EFI_SUCCESS) {
if (map->key_ptr)
*map->key_ptr = key;
if (map->desc_ver)
*map->desc_ver = desc_version;
} else {
efi_bs_call(free_pool, m);
if (map->key_ptr && status == EFI_SUCCESS)
*map->key_ptr = key;
if (map->desc_ver && status == EFI_SUCCESS)
*map->desc_ver = desc_version;
}
fail:
*map->map = m;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册