mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
udmabuf: use EBADFD in case we didn't got a memfd
Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
This commit is contained in:
parent
0d17455ca8
commit
7a1c67d780
1 changed files with 5 additions and 2 deletions
|
|
@ -154,14 +154,17 @@ static long udmabuf_create(const struct udmabuf_create_list *head,
|
|||
|
||||
pgbuf = 0;
|
||||
for (i = 0; i < head->count; i++) {
|
||||
ret = -EBADFD;
|
||||
memfd = fget(list[i].memfd);
|
||||
if (!memfd)
|
||||
goto err;
|
||||
if (!shmem_mapping(file_inode(memfd)->i_mapping))
|
||||
goto err;
|
||||
seals = memfd_fcntl(memfd, F_GET_SEALS, 0);
|
||||
if (seals == -EINVAL ||
|
||||
(seals & SEALS_WANTED) != SEALS_WANTED ||
|
||||
if (seals == -EINVAL)
|
||||
goto err;
|
||||
ret = -EINVAL;
|
||||
if ((seals & SEALS_WANTED) != SEALS_WANTED ||
|
||||
(seals & SEALS_DENIED) != 0)
|
||||
goto err;
|
||||
pgoff = list[i].offset >> PAGE_SHIFT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue