mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
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>
This commit is contained in:
parent
751e928d07
commit
e00b82db80
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue