[2021] 2009-03-07 Bean <[email protected]>

Bean <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2021
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2021
Author:   bean
Date:     2009-03-07 10:50:43 +0000 (Sat, 07 Mar 2009)
Log Message:
-----------
2009-03-07  Bean  <[email protected]>

	* loader/i386/efi/linux.c (grub_rescue_cmd_initrd): Fix a bug in initrd
	allocation.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/loader/i386/efi/linux.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-03-06 19:10:23 UTC (rev 2020)
+++ trunk/grub2/ChangeLog	2009-03-07 10:50:43 UTC (rev 2021)
@@ -1,3 +1,8 @@
+2009-03-07  Bean  <[email protected]>
+
+	* loader/i386/efi/linux.c (grub_rescue_cmd_initrd): Fix a bug in initrd
+	allocation.
+
 2009-03-06  Robert Millan  <[email protected]>
 
 	Fix display issue on terminals with screen size other than 80x25

Modified: trunk/grub2/loader/i386/efi/linux.c
===================================================================
--- trunk/grub2/loader/i386/efi/linux.c	2009-03-06 19:10:23 UTC (rev 2020)
+++ trunk/grub2/loader/i386/efi/linux.c	2009-03-07 10:50:43 UTC (rev 2021)
@@ -963,11 +963,15 @@
 	  if (physical_end > addr_max)
 	    physical_end = addr_max;
 
-          if (physical_end < addr_min)
+	  if (physical_end < page_align (size))
             continue;
 
-	  if (physical_end > addr)
-	    addr = physical_end - page_align (size);
+	  physical_end -= page_align (size);
+
+	  if ((physical_end >= addr_min) &&
+	      (physical_end >= desc->physical_start) &&
+	      (physical_end > addr))
+	    addr = physical_end;
 	}
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.