mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 14:10:43 +00:00
efi_memory: avoid NULL dereference in efi_free_pool
If efi_free_pool is called with argument NULL an illegal memory access occurs. So let's check the parameter on entry. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
70bfcdc6bb
commit
71275a3e98
1 changed files with 3 additions and 0 deletions
|
@ -379,6 +379,9 @@ efi_status_t efi_free_pool(void *buffer)
|
|||
efi_status_t r;
|
||||
struct efi_pool_allocation *alloc;
|
||||
|
||||
if (buffer == NULL)
|
||||
return EFI_INVALID_PARAMETER;
|
||||
|
||||
alloc = container_of(buffer, struct efi_pool_allocation, data);
|
||||
/* Sanity check, was the supplied address returned by allocate_pool */
|
||||
assert(((uintptr_t)alloc & EFI_PAGE_MASK) == 0);
|
||||
|
|
Loading…
Reference in a new issue