ed1787d
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
ed1787d
From: Daniel Axtens <dja@axtens.net>
ed1787d
Date: Thu, 25 Nov 2021 02:22:47 +1100
ed1787d
Subject: [PATCH] mm: grub_real_malloc(): Make small allocs comment match code
ed1787d
ed1787d
Small allocations move the region's *first pointer. The comment
ed1787d
says that this happens for allocations under 64K. The code says
ed1787d
it's for allocations under 32K. Commit 45bf8b3a7549 changed the
ed1787d
code intentionally: make the comment match.
ed1787d
ed1787d
Fixes: 45bf8b3a7549 (* grub-core/kern/mm.c (grub_real_malloc): Decrease cut-off of moving the)
ed1787d
ed1787d
Signed-off-by: Daniel Axtens <dja@axtens.net>
ed1787d
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
ed1787d
(cherry picked from commit a847895a8d000bdf27ad4d4326f883a0eed769ca)
ed1787d
---
ed1787d
 grub-core/kern/mm.c | 2 +-
ed1787d
 1 file changed, 1 insertion(+), 1 deletion(-)
ed1787d
ed1787d
diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
ed1787d
index fb20e93acf..db7e0b2a5b 100644
ed1787d
--- a/grub-core/kern/mm.c
ed1787d
+++ b/grub-core/kern/mm.c
ed1787d
@@ -306,7 +306,7 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align)
ed1787d
 	  /* Mark find as a start marker for next allocation to fasten it.
ed1787d
 	     This will have side effect of fragmenting memory as small
ed1787d
 	     pieces before this will be un-used.  */
ed1787d
-	  /* So do it only for chunks under 64K.  */
ed1787d
+	  /* So do it only for chunks under 32K.  */
ed1787d
 	  if (n < (0x8000 >> GRUB_MM_ALIGN_LOG2)
ed1787d
 	      || *first == cur)
ed1787d
 	    *first = prev;