summaryrefslogtreecommitdiffstats
path: root/drivers/tee
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-01-20 02:08:11 +0100
committerDave Airlie <airlied@redhat.com>2020-01-20 02:42:57 +0100
commit3d4743131b8de970faa4b979ead0fadfe5d2de9d (patch)
tree68e948c2d94d48598dd37e31bb654feb0b43ae4a /drivers/tee
parentMerge tag 'amd-drm-next-5.6-2020-01-17' of git://people.freedesktop.org/~agd5... (diff)
parentLinux 5.5-rc7 (diff)
downloadlinux-3d4743131b8de970faa4b979ead0fadfe5d2de9d.tar.xz
linux-3d4743131b8de970faa4b979ead0fadfe5d2de9d.zip
Backmerge v5.5-rc7 into drm-next
msm needs 5.5-rc4, go to the latest. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/tee')
-rw-r--r--drivers/tee/optee/shm_pool.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/tee/optee/shm_pool.c b/drivers/tee/optee/shm_pool.c
index 0332a5301d61..d767eebf30bd 100644
--- a/drivers/tee/optee/shm_pool.c
+++ b/drivers/tee/optee/shm_pool.c
@@ -28,9 +28,22 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm,
shm->size = PAGE_SIZE << order;
if (shm->flags & TEE_SHM_DMA_BUF) {
+ unsigned int nr_pages = 1 << order, i;
+ struct page **pages;
+
+ pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL);
+ if (!pages)
+ return -ENOMEM;
+
+ for (i = 0; i < nr_pages; i++) {
+ pages[i] = page;
+ page++;
+ }
+
shm->flags |= TEE_SHM_REGISTER;
- rc = optee_shm_register(shm->ctx, shm, &page, 1 << order,
+ rc = optee_shm_register(shm->ctx, shm, pages, nr_pages,
(unsigned long)shm->kaddr);
+ kfree(pages);
}
return rc;