mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
dma-buf: pass flags into dma_buf_fd.
We need to pass the flags into dma_buf_fd at this point, so the flags end up doing the right thing for O_CLOEXEC. Signed-off-by: Dave Airlie <[email protected]> Signed-off-by: Rob Clark <[email protected]> Signed-off-by: Sumit Semwal <[email protected]>
This commit is contained in:
parent
33ea2dcb39
commit
55c1c4ca23
2 changed files with 4 additions and 3 deletions
|
|
@ -107,17 +107,18 @@ EXPORT_SYMBOL_GPL(dma_buf_export);
|
|||
/**
|
||||
* dma_buf_fd - returns a file descriptor for the given dma_buf
|
||||
* @dmabuf: [in] pointer to dma_buf for which fd is required.
|
||||
* @flags: [in] flags to give to fd
|
||||
*
|
||||
* On success, returns an associated 'fd'. Else, returns error.
|
||||
*/
|
||||
int dma_buf_fd(struct dma_buf *dmabuf)
|
||||
int dma_buf_fd(struct dma_buf *dmabuf, int flags)
|
||||
{
|
||||
int error, fd;
|
||||
|
||||
if (!dmabuf || !dmabuf->file)
|
||||
return -EINVAL;
|
||||
|
||||
error = get_unused_fd();
|
||||
error = get_unused_fd_flags(flags);
|
||||
if (error < 0)
|
||||
return error;
|
||||
fd = error;
|
||||
|
|
|
|||
Loading…
Reference in a new issue