aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/dma-buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/dma-buf.c')
-rw-r--r--drivers/base/dma-buf.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index a3f79c495a4..ff5b745c470 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -134,15 +134,14 @@ EXPORT_SYMBOL_GPL(dma_buf_export);
*/
int dma_buf_fd(struct dma_buf *dmabuf, int flags)
{
- int error, fd;
+ int fd;
if (!dmabuf || !dmabuf->file)
return -EINVAL;
- error = get_unused_fd_flags(flags);
- if (error < 0)
- return error;
- fd = error;
+ fd = get_unused_fd_flags(flags);
+ if (fd < 0)
+ return fd;
fd_install(fd, dmabuf->file);