tee: tee_shm_op_mmap(): use TEE_SHM_USER_MAPPED

tee_shm_op_mmap() uses the TEE_SHM_USER_MAPPED flag instead of the
TEE_SHM_REGISTER flag to tell if a shared memory object is originating
from registered user space memory.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
Jens Wiklander 2019-11-07 11:43:02 +01:00
parent 5271b2011e
commit 758ecf13a4
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ static int tee_shm_op_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
size_t size = vma->vm_end - vma->vm_start; size_t size = vma->vm_end - vma->vm_start;
/* Refuse sharing shared memory provided by application */ /* Refuse sharing shared memory provided by application */
if (shm->flags & TEE_SHM_REGISTER) if (shm->flags & TEE_SHM_USER_MAPPED)
return -EINVAL; return -EINVAL;
return remap_pfn_range(vma, vma->vm_start, shm->paddr >> PAGE_SHIFT, return remap_pfn_range(vma, vma->vm_start, shm->paddr >> PAGE_SHIFT,