dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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