Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 295721b3 authored by Patrick Daly's avatar Patrick Daly
Browse files

ion: ion_system_heap: SetPagePrivate when splitting secure pages



The kgsl driver relies on checking the PagePrivate flag for secure memory.
Commit 471a5dd2 ("ion: system_heap:
Add a new allocation method") did not properly set this flag in all cases.
Fix this.

Change-Id: I4f29ee151158cd70a1617d365decc7d3fd8fe6ac
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 0b388677
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -204,11 +204,16 @@ static struct page *split_page_from_secure_pool(struct ion_system_heap *heap,
		split_page(page, order);
		break;
	}
	/* Return the remaining order-0 pages to the pool */
	if (page)
		for (j = 1; j < (1 << order); j++)
	/*
	 * Return the remaining order-0 pages to the pool.
	 * SetPagePrivate flag to mark memory as secure.
	 */
	if (page) {
		for (j = 1; j < (1 << order); j++) {
			SetPagePrivate(page + j);
			free_buffer_page(heap, buffer, page + j, 0);

		}
	}
got_page:
	mutex_unlock(&heap->split_page_mutex);