aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/platform/efi/efi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index c89c245eff40..3f96a487aa2a 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -1018,7 +1018,12 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
1018 if (status != EFI_SUCCESS) 1018 if (status != EFI_SUCCESS)
1019 return status; 1019 return status;
1020 1020
1021 if (!storage_size || size > remaining_size || size > max_size || 1021 if (!max_size && remaining_size > size)
1022 printk_once(KERN_ERR FW_BUG "Broken EFI implementation"
1023 " is returning MaxVariableSize=0\n");
1024
1025 if (!storage_size || size > remaining_size ||
1026 (max_size && size > max_size) ||
1022 (remaining_size - size) < (storage_size / 2)) 1027 (remaining_size - size) < (storage_size / 2))
1023 return EFI_OUT_OF_RESOURCES; 1028 return EFI_OUT_OF_RESOURCES;
1024 1029