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

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