Skip to content

Commit

Permalink
core: mm: zero initialize phys_mem pool instances
Browse files Browse the repository at this point in the history
Ensure phys_mem pool instance structure is zero initialized when
created. This change fixes an issue where phys_mem pool max_allocated
field may contain a fuzzy value.

Fixes: c596d83 ("core: add phys_mem allocation functions")
Signed-off-by: Etienne Carriere <[email protected]>
  • Loading branch information
etienne-lms committed Jan 16, 2025
1 parent b8a9277 commit c60200b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/mm/phys_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ static tee_mm_pool_t *init_pool(paddr_t b, paddr_size_t sz, uint32_t flags)
panic("invalid phys mem");

if (flags & TEE_MM_POOL_NEX_MALLOC)
pool = nex_malloc(sizeof(*pool));
pool = nex_calloc(1, sizeof(*pool));
else
pool = malloc(sizeof(*pool));
pool = calloc(1, sizeof(*pool));
if (!pool)
panic();

Expand Down

0 comments on commit c60200b

Please sign in to comment.