projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
751e928
)
efi_loader: FreePages() must fail with pages = 0
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Thu, 25 Apr 2019 16:41:40 +0000
(18:41 +0200)
committer
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Thu, 2 May 2019 16:17:49 +0000
(18:17 +0200)
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>
lib/efi_loader/efi_memory.c
patch
|
blob
|
history
diff --git
a/lib/efi_loader/efi_memory.c
b/lib/efi_loader/efi_memory.c
index 987cc6dc5f61aaaec7fea74c8e87ecbd0c927a90..776077cc35aa2f22fc55171127f7ba9bcf4d747d 100644
(file)
--- 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;