diff options
| author | Patrick Daly <pdaly@codeaurora.org> | 2016-09-23 15:33:58 -0700 |
|---|---|---|
| committer | Patrick Daly <pdaly@codeaurora.org> | 2016-10-03 18:42:01 -0700 |
| commit | 295721b3638f82b5197d610e0099e67b9e8e652e (patch) | |
| tree | e175a7de93786971bb74f8648363652cca013145 | |
| parent | 0b3886773c113fe0ad5748d8f5a9d1648fafdee2 (diff) | |
ion: ion_system_heap: SetPagePrivate when splitting secure pages
The kgsl driver relies on checking the PagePrivate flag for secure memory.
Commit 471a5dd2373eafe9fd9209a44f284716005335cf ("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: Patrick Daly <pdaly@codeaurora.org>
| -rw-r--r-- | drivers/staging/android/ion/ion_system_heap.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index fd4d45ad8db2..03b2b8a38991 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -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); |
