From: Zhou JianFeng <jianfeng.z...@intel.com> Memory freed by function grub_efi_free_pages() with wrong pages will not be removed from list efi_allocated_memory by function grub_efi_drop_alloc(), it will be freed again by function grub_efi_memory_fini() which is called by function grub_machine_fini()/grub_exit() when exit grub. Freeing memory twice may lead to unpredictable result.
Cc: daniel.ki...@oracle.com Cc: alexander.burmas...@oracle.com Cc: phco...@gmail.com Signed-off-by: Zhou JianFeng <jianfeng.z...@intel.com> --- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index 6a6fba891..49daa976f 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -643,7 +643,7 @@ grub_efi_mm_add_regions (grub_size_t required_bytes, unsigned int flags) /* Release the memory maps. */ grub_efi_free_pages ((grub_addr_t) memory_map, - 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); + 2 * BYTES_TO_PAGES (map_size)); return GRUB_ERR_NONE; } -- 2.25.1 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel