gpu: ion: Fix bug in zeroing pages in system heap
Pages are zeroed for security purposes when returned to the
ion heap. There was a bug in this code preventing this
from happening.
Bug: 7573871
Change-Id: I2b363924b7a352a4a8170a78777c01a04ac3f0ed
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Git-commit: 78290a298e0659e016d9baae186dc8faed0a0382
Git-repo: https://android.googlesource.com/kernel/common
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
diff --git a/drivers/gpu/ion/ion_system_heap.c b/drivers/gpu/ion/ion_system_heap.c
index b22faea..87135c5 100644
--- a/drivers/gpu/ion/ion_system_heap.c
+++ b/drivers/gpu/ion/ion_system_heap.c
@@ -114,7 +114,7 @@
security. This uses vmap as we want to set the pgprot so
the writes to occur to noncached mappings, as the pool's
purpose is to keep the pages out of the cache */
- for (i = 0; i < order / PAGE_SIZE; i++) {
+ for (i = 0; i < (1 << order); i++) {
struct page *sub_page = page + i;
void *addr = vmap(&sub_page, 1, VM_MAP,
pgprot_writecombine(PAGE_KERNEL));