[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] kern/efi/mm: Change grub_efi_allocate_pages_real() to ca
From: |
Daniel Kiper |
Subject: |
Re: [PATCH 2/3] kern/efi/mm: Change grub_efi_allocate_pages_real() to call semantically correct free function |
Date: |
Wed, 12 Jun 2024 18:02:59 +0200 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Wed, Jun 12, 2024 at 04:10:50PM +0100, Mate Kukri wrote:
> If the firmware happens to return 0 as an address of allocated pages,
> grub_efi_allocate_pages_real() tries to allocate a new set of pages,
> and then free the ones at address 0.
>
> However at that point grub_efi_store_alloc() wasn't yet called, so
> freeing the pages at 0 using grub_efi_free_pages() which calls
> grub_efi_drop_alloc() isn't necessary, so let's call b->free_pages()
> instead.
>
> The call to grub_efi_drop_alloc() doesn't seem particularly harmful,
> because it seems to do nothing if the allocation it is asked to drop
> isn't on the list, but the call to it is obviously unnecessary here.
>
> Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Daniel