diff options
author | Richard Weinberger <richard@nod.at> | 2013-04-10 04:59:34 -0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2013-04-11 10:45:52 -0400 |
commit | 7791c8423f1f7f4dad94e753bae67461d5b80be8 (patch) | |
tree | 54b619a807a75adef8551f1db76250b22b151f8f /arch | |
parent | a6e4d5a03e9e3587e88aba687d8f225f4f04c792 (diff) |
x86,efi: Check max_size only if it is non-zero.
Some EFI implementations return always a MaximumVariableSize of 0,
check against max_size only if it is non-zero.
My Intel DQ67SW desktop board has such an implementation.
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/platform/efi/efi.c | 7 |
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 | ||