ion: Check for PagePrivate in free_buffer_page

There is a possibility of non secure pages getting added
to secure pool one such case is in secure system heap alloc
failure path, Fix this by checking if page is private before
selecting the pool.

Change-Id: I5d7e94040fcbdb7aa2621eb537c8bc249887fc4f
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
This commit is contained in:
Vijayanand Jitta 2021-04-07 11:26:57 +05:30
commit 0f9dbcc5e1

View file

@ -143,7 +143,7 @@ void free_buffer_page(struct ion_msm_system_heap *heap,
if (!(buffer->flags & ION_FLAG_POOL_FORCE_ALLOC)) {
struct ion_msm_page_pool *pool;
if (vmid > 0)
if (vmid > 0 && PagePrivate(page))
pool = heap->secure_pools[vmid][order_to_index(order)];
else if (cached)
pool = heap->cached_pools[order_to_index(order)];