summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-10-06 12:26:08 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-06 12:26:08 -0700
commit2c11780bfaa1975ba2e614ad7c5059de8191ff15 (patch)
tree751c7e04ae16f2b34cff3862aae610e06530879a
parentb80c3a0a3ac9335355d2a3d5097123da4e79585d (diff)
parent295721b3638f82b5197d610e0099e67b9e8e652e (diff)
Merge "ion: ion_system_heap: SetPagePrivate when splitting secure pages"
-rw-r--r--drivers/staging/android/ion/ion_system_heap.c13
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);