From 8ec390e2fd70bb520e01482c8d178f8c5bb7fcb1 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Wed, 10 Apr 2013 10:59:34 +0200 Subject: [PATCH] --- yaml --- r: 362694 b: refs/heads/master c: 7791c8423f1f7f4dad94e753bae67461d5b80be8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/platform/efi/efi.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index da31cd8b507e..2341faee0137 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a6e4d5a03e9e3587e88aba687d8f225f4f04c792 +refs/heads/master: 7791c8423f1f7f4dad94e753bae67461d5b80be8 diff --git a/trunk/arch/x86/platform/efi/efi.c b/trunk/arch/x86/platform/efi/efi.c index c89c245eff40..3f96a487aa2a 100644 --- a/trunk/arch/x86/platform/efi/efi.c +++ b/trunk/arch/x86/platform/efi/efi.c @@ -1018,7 +1018,12 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size) if (status != EFI_SUCCESS) return status; - if (!storage_size || size > remaining_size || size > max_size || + if (!max_size && remaining_size > size) + printk_once(KERN_ERR FW_BUG "Broken EFI implementation" + " is returning MaxVariableSize=0\n"); + + if (!storage_size || size > remaining_size || + (max_size && size > max_size) || (remaining_size - size) < (storage_size / 2)) return EFI_OUT_OF_RESOURCES;