File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 17
17
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
18
18
*/
19
19
20
+ #include <grub/types.h>
20
21
#include <grub/efi/api.h>
21
22
#include <grub/efi/efi.h>
22
23
#include <grub/elf.h>
@@ -500,6 +501,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
500
501
{
501
502
grub_size_t size = 0 ;
502
503
void * initrd_dest ;
504
+ void * balloon = NULL ;
503
505
grub_err_t err ;
504
506
struct grub_linux_initrd_context initrd_ctx = { 0 , 0 , 0 };
505
507
@@ -517,6 +519,14 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
517
519
518
520
size = grub_get_initrd_size (& initrd_ctx );
519
521
522
+ // make sure we can allocate sufficient memory for the initrd
523
+ balloon = grub_memalign (0x10000 , size );
524
+ if (!balloon )
525
+ goto fail ;
526
+ else
527
+ // free this region for the relocator
528
+ grub_free (balloon );
529
+
520
530
{
521
531
grub_relocator_chunk_t ch ;
522
532
err = grub_relocator_alloc_chunk_align (relocator , & ch ,
You can’t perform that action at this time.
0 commit comments