efi/libstub: Simplify efi_get_memory_map()
Do not check the value of status twice. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Link: https://lore.kernel.org/r/20200216184050.3100-1-xypron.glpk@gmx.de Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:

committed by
Ard Biesheuvel

parent
eaa6fc67e1
commit
e7ea37b00d
@@ -52,13 +52,14 @@ again:
|
||||
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;
|
||||
|
Reference in New Issue
Block a user