nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Vladimir Serbinenko <phcoder@gmail.com>
f725e3
Date: Wed, 26 Mar 2014 08:48:30 +0100
f725e3
Subject: [PATCH] * grub-core/lib/relocator.c: Fix the case when end of
f725e3
 leftover is used.
f725e3
f725e3
---
f725e3
 grub-core/lib/relocator.c | 2 ++
f725e3
 ChangeLog                 | 4 ++++
f725e3
 2 files changed, 6 insertions(+)
f725e3
f725e3
diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c
f725e3
index 9f9770bc48d..cb11ea5fa27 100644
f725e3
--- a/grub-core/lib/relocator.c
f725e3
+++ b/grub-core/lib/relocator.c
f725e3
@@ -865,6 +865,8 @@ malloc_in_range (struct grub_relocator *rel,
f725e3
 			% GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT;
f725e3
 		      struct grub_relocator_fw_leftover *lo
f725e3
 			= events[last_lo].leftover;
f725e3
+		      if (offend == 0 && alloc_end != alloc_start)
f725e3
+			offend = GRUB_RELOCATOR_FIRMWARE_REQUESTS_QUANT;
f725e3
 		      lo->freebytes[offstart / 8]
f725e3
 			&= ((1 << (8 - (start % 8))) - 1);
f725e3
 		      grub_memset (lo->freebytes + (offstart + 7) / 8, 0,
f725e3
diff --git a/ChangeLog b/ChangeLog
f725e3
index 091535beb5c..9404edab8e1 100644
f725e3
--- a/ChangeLog
f725e3
+++ b/ChangeLog
f725e3
@@ -1,3 +1,7 @@
f725e3
+2014-03-26  Vladimir Serbinenko  <phcoder@gmail.com>
f725e3
+
f725e3
+	* grub-core/lib/relocator.c: Fix the case when end of leftover is used.
f725e3
+
f725e3
 2014-03-26  Fu Wei <fu.wei@linaro.org>
f725e3
 
f725e3
 	* grub-core/loader/arm64/linux.c: Remove redundant "0x".