2012-08-14 20:38:19 +00:00
|
|
|
From: Stuart Hayes <stuart_hayes@dell.com>
|
2012-08-08 17:38:23 +00:00
|
|
|
Subject: Don't decrease efi memory map size
|
|
|
|
Date: 2012-07-02 09:14:37 +0000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- a/grub-core/loader/i386/linux.c 2012-06-27 20:55:09 +0000
|
|
|
|
+++ b/grub-core/loader/i386/linux.c 2012-07-02 09:14:37 +0000
|
|
|
|
@@ -118,12 +118,13 @@
|
|
|
|
int ret;
|
|
|
|
grub_efi_memory_descriptor_t *mmap;
|
|
|
|
grub_efi_uintn_t desc_size;
|
|
|
|
+ grub_efi_uintn_t cur_mmap_size = mmap_size;
|
|
|
|
|
|
|
|
- mmap = grub_malloc (mmap_size);
|
|
|
|
+ mmap = grub_malloc (cur_mmap_size);
|
|
|
|
if (! mmap)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
- ret = grub_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0);
|
|
|
|
+ ret = grub_efi_get_memory_map (&cur_mmap_size, mmap, 0, &desc_size, 0);
|
|
|
|
grub_free (mmap);
|
|
|
|
|
|
|
|
if (ret < 0)
|
|
|
|
@@ -134,6 +135,8 @@
|
|
|
|
else if (ret > 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
+ if (mmap_size < cur_mmap_size)
|
|
|
|
+ mmap_size = cur_mmap_size;
|
|
|
|
mmap_size += (1 << 12);
|
|
|
|
}
|
|
|
|
|
|
|
|
|