Skip to content

Commit

Permalink
dma_buf_getfile(): don't bother with ->f_flags reassignments
Browse files Browse the repository at this point in the history
just pass the already sanitized value to alloc_file_pseudo().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Aug 17, 2022
1 parent 25885a3 commit 47091e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma-buf/dma-buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,11 @@ static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags)
* value.
*/
inode->i_ino = atomic64_add_return(1, &dmabuf_inode);
flags &= O_ACCMODE | O_NONBLOCK;
file = alloc_file_pseudo(inode, dma_buf_mnt, "dmabuf",
flags, &dma_buf_fops);
if (IS_ERR(file))
goto err_alloc_file;
file->f_flags = flags & (O_ACCMODE | O_NONBLOCK);
file->private_data = dmabuf;
file->f_path.dentry->d_fsdata = dmabuf;

Expand Down

0 comments on commit 47091e4

Please sign in to comment.