diff options
-rw-r--r-- | drivers/tee/tee_shm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index 556960a1bab3..07d3be6f0780 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c | |||
@@ -360,9 +360,10 @@ int tee_shm_get_fd(struct tee_shm *shm) | |||
360 | if (!(shm->flags & TEE_SHM_DMA_BUF)) | 360 | if (!(shm->flags & TEE_SHM_DMA_BUF)) |
361 | return -EINVAL; | 361 | return -EINVAL; |
362 | 362 | ||
363 | get_dma_buf(shm->dmabuf); | ||
363 | fd = dma_buf_fd(shm->dmabuf, O_CLOEXEC); | 364 | fd = dma_buf_fd(shm->dmabuf, O_CLOEXEC); |
364 | if (fd >= 0) | 365 | if (fd < 0) |
365 | get_dma_buf(shm->dmabuf); | 366 | dma_buf_put(shm->dmabuf); |
366 | return fd; | 367 | return fd; |
367 | } | 368 | } |
368 | 369 | ||