From: Al Viro Date: Sun, 20 Jun 2021 17:53:35 +0000 (-0400) Subject: dma_buf_getfile(): don't bother with ->f_flags reassignments X-Git-Tag: v6.1-rc5~295^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47091e4ed9af648d6cfa3a5f0809ece371294ecb;p=platform%2Fkernel%2Flinux-starfive.git dma_buf_getfile(): don't bother with ->f_flags reassignments just pass the already sanitized value to alloc_file_pseudo(). Signed-off-by: Al Viro --- diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index efb4990..1b1c1c0 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -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;