aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2013-10-31 12:25:09 -0400
committerMatt Fleming <matt.fleming@intel.com>2013-11-02 07:09:36 -0400
commitee41143027706d9f342dfe05487a00b20887fde7 (patch)
tree2e4a0bf717d2e171b562b177f5571c5b8659d48b
parentd2f7cbe7b26a74dbbbf8f325b2a6fd01bc34032c (diff)
x86/efi: Check krealloc return value
Check it just in case. We might just as well panic there because runtime won't be functioning anyway. Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--arch/x86/platform/efi/efi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index b453069236fd..3fac4dee492f 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -860,6 +860,9 @@ void __init efi_enter_virtual_mode(void)
860 new_memmap = krealloc(new_memmap, 860 new_memmap = krealloc(new_memmap,
861 (count + 1) * memmap.desc_size, 861 (count + 1) * memmap.desc_size,
862 GFP_KERNEL); 862 GFP_KERNEL);
863 if (!new_memmap)
864 goto err_out;
865
863 memcpy(new_memmap + (count * memmap.desc_size), md, 866 memcpy(new_memmap + (count * memmap.desc_size), md,
864 memmap.desc_size); 867 memmap.desc_size);
865 count++; 868 count++;
@@ -914,6 +917,11 @@ void __init efi_enter_virtual_mode(void)
914 EFI_VARIABLE_BOOTSERVICE_ACCESS | 917 EFI_VARIABLE_BOOTSERVICE_ACCESS |
915 EFI_VARIABLE_RUNTIME_ACCESS, 918 EFI_VARIABLE_RUNTIME_ACCESS,
916 0, NULL); 919 0, NULL);
920
921 return;
922
923 err_out:
924 pr_err("Error reallocating memory, EFI runtime non-functional!\n");
917} 925}
918 926
919/* 927/*