Commit 7a1c67d7 authored by Gerd Hoffmann's avatar Gerd Hoffmann
parent 0d17455c
...@@ -154,14 +154,17 @@ static long udmabuf_create(const struct udmabuf_create_list *head, ...@@ -154,14 +154,17 @@ static long udmabuf_create(const struct udmabuf_create_list *head,
pgbuf = 0; pgbuf = 0;
for (i = 0; i < head->count; i++) { for (i = 0; i < head->count; i++) {
ret = -EBADFD;
memfd = fget(list[i].memfd); memfd = fget(list[i].memfd);
if (!memfd) if (!memfd)
goto err; goto err;
if (!shmem_mapping(file_inode(memfd)->i_mapping)) if (!shmem_mapping(file_inode(memfd)->i_mapping))
goto err; goto err;
seals = memfd_fcntl(memfd, F_GET_SEALS, 0); seals = memfd_fcntl(memfd, F_GET_SEALS, 0);
if (seals == -EINVAL || if (seals == -EINVAL)
(seals & SEALS_WANTED) != SEALS_WANTED || goto err;
ret = -EINVAL;
if ((seals & SEALS_WANTED) != SEALS_WANTED ||
(seals & SEALS_DENIED) != 0) (seals & SEALS_DENIED) != 0)
goto err; goto err;
pgoff = list[i].offset >> PAGE_SHIFT; pgoff = list[i].offset >> PAGE_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment