]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/base/dma-buf.c
Merge tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[karo-tx-linux.git] / drivers / base / dma-buf.c
index c30f3e1d0efcc7bcb443051cab59930b06d72b74..a3f79c495a411ea85b87604ab473fcef6b962558 100644 (file)
@@ -298,6 +298,8 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
                                struct sg_table *sg_table,
                                enum dma_data_direction direction)
 {
+       might_sleep();
+
        if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
                return;
 
@@ -460,8 +462,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,
        if (vma->vm_file)
                fput(vma->vm_file);
 
-       vma->vm_file = dmabuf->file;
-       get_file(vma->vm_file);
+       vma->vm_file = get_file(dmabuf->file);
 
        vma->vm_pgoff = pgoff;