Lines Matching full:shm

260 	struct tee_shm *shm;  in tee_ioctl_shm_alloc()  local
269 shm = tee_shm_alloc_user_buf(ctx, data.size); in tee_ioctl_shm_alloc()
270 if (IS_ERR(shm)) in tee_ioctl_shm_alloc()
271 return PTR_ERR(shm); in tee_ioctl_shm_alloc()
273 data.id = shm->id; in tee_ioctl_shm_alloc()
274 data.size = shm->size; in tee_ioctl_shm_alloc()
279 ret = tee_shm_get_fd(shm); in tee_ioctl_shm_alloc()
286 tee_shm_put(shm); in tee_ioctl_shm_alloc()
296 struct tee_shm *shm; in tee_ioctl_shm_register() local
305 shm = tee_shm_register_user_buf(ctx, data.addr, data.length); in tee_ioctl_shm_register()
306 if (IS_ERR(shm)) in tee_ioctl_shm_register()
307 return PTR_ERR(shm); in tee_ioctl_shm_register()
309 data.id = shm->id; in tee_ioctl_shm_register()
310 data.length = shm->size; in tee_ioctl_shm_register()
315 ret = tee_shm_get_fd(shm); in tee_ioctl_shm_register()
321 tee_shm_put(shm); in tee_ioctl_shm_register()
330 struct tee_shm *shm; in tee_ioctl_shm_register_fd() local
340 shm = tee_shm_register_fd(ctx, data.fd); in tee_ioctl_shm_register_fd()
341 if (IS_ERR(shm)) in tee_ioctl_shm_register_fd()
344 data.id = shm->id; in tee_ioctl_shm_register_fd()
345 data.flags = shm->flags; in tee_ioctl_shm_register_fd()
346 data.size = shm->size; in tee_ioctl_shm_register_fd()
351 ret = tee_shm_get_fd(shm); in tee_ioctl_shm_register_fd()
358 tee_shm_put(shm); in tee_ioctl_shm_register_fd()
366 struct tee_shm *shm; in param_from_user_memref() local
384 shm = tee_shm_get_from_id(ctx, ip->c); in param_from_user_memref()
385 if (IS_ERR(shm)) in param_from_user_memref()
386 return PTR_ERR(shm); in param_from_user_memref()
394 (ip->a + ip->b) > shm->size) { in param_from_user_memref()
395 tee_shm_put(shm); in param_from_user_memref()
399 if (shm->flags & TEE_SHM_DMA_BUF) { in param_from_user_memref()
402 ref = container_of(shm, struct tee_shm_dmabuf_ref, shm); in param_from_user_memref()
405 * The shm already has one reference to in param_from_user_memref()
408 * this shm will be used in the parameter in param_from_user_memref()
409 * list instead of the shm we got with in param_from_user_memref()
413 tee_shm_put(shm); in param_from_user_memref()
414 shm = ref->parent_shm; in param_from_user_memref()
420 shm = NULL; in param_from_user_memref()
427 memref->shm = shm; in param_from_user_memref()
603 params[n].u.memref.shm) in tee_ioctl_open_session()
604 tee_shm_put(params[n].u.memref.shm); in tee_ioctl_open_session()
664 params[n].u.memref.shm) in tee_ioctl_invoke()
665 tee_shm_put(params[n].u.memref.shm); in tee_ioctl_invoke()
723 params[n].u.memref.shm) in tee_ioctl_object_invoke()
724 tee_shm_put(params[n].u.memref.shm); in tee_ioctl_object_invoke()
795 if (!p->u.memref.shm) { in params_to_supp()
797 ip.c = (u64)-1; /* invalid shm id */ in params_to_supp()
801 ip.c = p->u.memref.shm->id; in params_to_supp()
917 p->u.memref.shm = NULL; in params_from_supp()