Skip to content
Commit e6ea5644 authored by Mirai SHINJO's avatar Mirai SHINJO Committed by Anas Nashif
Browse files

kernel: mmu: fix memory leak in virt_region_alloc()



The error path for an invalid destination address in virt_region_alloc()
frees the allocation using the originally requested 'size' instead of
the 'num_bits' that were actually allocated from the bitmap.
This leaks the virtual address space.

Pass 'num_bits' instead of 'size' to sys_bitarray_free() to ensure the
allocated region is correctly freed.

Signed-off-by: default avatarMirai SHINJO <oss@mshinjo.com>
parent e2aa3cea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment