mirror of
https://src.fedoraproject.org/rpms/grub2.git
synced 2024-11-24 14:32:58 +00:00
f74b50e380
Signed-off-by: Peter Jones <pjones@redhat.com>
49 lines
1.5 KiB
Diff
49 lines
1.5 KiB
Diff
From 0397c8a6d1c65c7e7216324f0c63e386e9b6c5ed Mon Sep 17 00:00:00 2001
|
|
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
|
|
Date: Sat, 20 Apr 2013 17:39:49 +0200
|
|
Subject: [PATCH 332/482] * grub-core/kern/mm.c (grub_mm_init_region):
|
|
Fix condition for detecting too small regions.
|
|
|
|
---
|
|
ChangeLog | 5 +++++
|
|
grub-core/kern/mm.c | 5 +++--
|
|
2 files changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/ChangeLog b/ChangeLog
|
|
index b2e3ccc..2a4264c 100644
|
|
--- a/ChangeLog
|
|
+++ b/ChangeLog
|
|
@@ -1,5 +1,10 @@
|
|
2013-04-20 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
|
+ * grub-core/kern/mm.c (grub_mm_init_region): Fix condition for
|
|
+ detecting too small regions.
|
|
+
|
|
+2013-04-20 Vladimir Serbinenko <phcoder@gmail.com>
|
|
+
|
|
* grub-core/Makefile.core.def (legacycfg): Enable on EFI.
|
|
|
|
2013-04-20 Vladimir Serbinenko <phcoder@gmail.com>
|
|
diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
|
|
index d869091..959c3ba 100644
|
|
--- a/grub-core/kern/mm.c
|
|
+++ b/grub-core/kern/mm.c
|
|
@@ -140,12 +140,13 @@ grub_mm_init_region (void *addr, grub_size_t size)
|
|
|
|
/* Allocate a region from the head. */
|
|
r = (grub_mm_region_t) ALIGN_UP ((grub_addr_t) addr, GRUB_MM_ALIGN);
|
|
- size -= (char *) r - (char *) addr + sizeof (*r);
|
|
|
|
/* If this region is too small, ignore it. */
|
|
- if (size < GRUB_MM_ALIGN)
|
|
+ if (size < GRUB_MM_ALIGN + (char *) r - (char *) addr + sizeof (*r))
|
|
return;
|
|
|
|
+ size -= (char *) r - (char *) addr + sizeof (*r);
|
|
+
|
|
h = (grub_mm_header_t) (r + 1);
|
|
h->next = h;
|
|
h->magic = GRUB_MM_FREE_MAGIC;
|
|
--
|
|
1.8.2.1
|
|
|