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