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

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