From: Heinrich Schuchardt Date: Sun, 16 Feb 2020 18:40:50 +0000 (+0100) Subject: efi/libstub: Simplify efi_get_memory_map() X-Git-Tag: v5.7-rc1~182^2~31^2~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7ea37b00da43e8f1154b35ef7f1e3aff45981d3;p=thirdparty%2Flinux.git efi/libstub: Simplify efi_get_memory_map() Do not check the value of status twice. Signed-off-by: Heinrich Schuchardt Link: https://lore.kernel.org/r/20200216184050.3100-1-xypron.glpk@gmx.de Signed-off-by: Ard Biesheuvel --- diff --git a/drivers/firmware/efi/libstub/mem.c b/drivers/firmware/efi/libstub/mem.c index 17060086913a6..2499e04850818 100644 --- a/drivers/firmware/efi/libstub/mem.c +++ b/drivers/firmware/efi/libstub/mem.c @@ -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;