diff options
author | Sylvain Gault <sylvain.gault@gmail.com> | 2014-02-13 03:20:05 +0100 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-02-13 15:39:20 -0800 |
commit | e6374f1c88f925bd01212a783680eda928ecfff9 (patch) | |
tree | 99c7d0907c32835d9288c5f181830fb4f6845cba /efi/main.c | |
parent | 83730db928b303bc3e9f7bd35c2e64cd85ab0267 (diff) | |
download | syslinux-e6374f1c88f925bd01212a783680eda928ecfff9.tar.gz |
efi: Suspicious size reduction in emalloc
It could happen on 32 bits architecture that the memory size really allocated
could be less than required. On 64 bits, allocate_pages may be called
more times than needed.
This closes bug #39.
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'efi/main.c')
-rw-r--r-- | efi/main.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -691,10 +691,8 @@ EFI_STATUS emalloc(UINTN size, UINTN align, EFI_PHYSICAL_ADDRESS *addr) /* Low-memory is super-precious! */ if (end <= 1 << 20) continue; - if (start < 1 << 20) { - size -= (1 << 20) - start; + if (start < 1 << 20) start = (1 << 20); - } aligned = (start + align -1) & ~(align -1); |