diff options
author | Dave Airlie <airlied@redhat.com> | 2020-01-20 02:08:11 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-01-20 02:42:57 +0100 |
commit | 3d4743131b8de970faa4b979ead0fadfe5d2de9d (patch) | |
tree | 68e948c2d94d48598dd37e31bb654feb0b43ae4a /drivers/tee | |
parent | Merge tag 'amd-drm-next-5.6-2020-01-17' of git://people.freedesktop.org/~agd5... (diff) | |
parent | Linux 5.5-rc7 (diff) | |
download | linux-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.c | 15 |
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; |