diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-04-25 19:41:40 +0300 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-05-02 19:17:49 +0300 |
commit | e00b82db809725ead77ddfe602c9c8fad1f45ab7 (patch) | |
tree | 5ef3163c65e4de0eb7aace97adcabeaebbaaa362 /lib/efi_loader/efi_memory.c | |
parent | 751e928d07ae6ddb2b770b3a4c7f74fd6f2a5a64 (diff) | |
download | u-boot-e00b82db809725ead77ddfe602c9c8fad1f45ab7.tar.xz |
efi_loader: FreePages() must fail with pages = 0
The UEFI spec requires that freeing of pages fails if the number of pages
to be freed is 'invalid'. Check that it is not zero.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader/efi_memory.c')
-rw-r--r-- | lib/efi_loader/efi_memory.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 987cc6dc5f..776077cc35 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -452,7 +452,7 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages) uint64_t r = 0; /* Sanity check */ - if (!memory || (memory & EFI_PAGE_MASK)) { + if (!memory || (memory & EFI_PAGE_MASK) || !pages) { printf("%s: illegal free 0x%llx, 0x%zx\n", __func__, memory, pages); return EFI_INVALID_PARAMETER; |