projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
tee: shm: fix use-after-free via temporarily dropped reference
[linux-2.6-microblaze.git]
/
drivers
/
tee
/
tee_shm.c
diff --git
a/drivers/tee/tee_shm.c
b/drivers/tee/tee_shm.c
index
556960a
..
07d3be6
100644
(file)
--- 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)
if (!(shm->flags & TEE_SHM_DMA_BUF))
return -EINVAL;
+ get_dma_buf(shm->dmabuf);
fd = dma_buf_fd(shm->dmabuf, O_CLOEXEC);
- if (fd
>=
0)
-
get_dma_buf
(shm->dmabuf);
+ if (fd
<
0)
+
dma_buf_put
(shm->dmabuf);
return fd;
}