Merge "msm: kgsl: Use vma_area_struct with proper locks"

This commit is contained in:
Linux Build Service Account 2017-07-12 12:47:37 -07:00 committed by Gerrit - the friendly Code Review server
commit 27ee915218

View file

@ -2210,21 +2210,23 @@ static int kgsl_setup_dmabuf_useraddr(struct kgsl_device *device,
if (fd != 0) if (fd != 0)
dmabuf = dma_buf_get(fd - 1); dmabuf = dma_buf_get(fd - 1);
} }
up_read(&current->mm->mmap_sem);
if (IS_ERR_OR_NULL(dmabuf)) if (IS_ERR_OR_NULL(dmabuf)) {
up_read(&current->mm->mmap_sem);
return dmabuf ? PTR_ERR(dmabuf) : -ENODEV; return dmabuf ? PTR_ERR(dmabuf) : -ENODEV;
}
ret = kgsl_setup_dma_buf(device, pagetable, entry, dmabuf); ret = kgsl_setup_dma_buf(device, pagetable, entry, dmabuf);
if (ret) { if (ret) {
dma_buf_put(dmabuf); dma_buf_put(dmabuf);
up_read(&current->mm->mmap_sem);
return ret; return ret;
} }
/* Setup the user addr/cache mode for cache operations */ /* Setup the user addr/cache mode for cache operations */
entry->memdesc.useraddr = hostptr; entry->memdesc.useraddr = hostptr;
_setup_cache_mode(entry, vma); _setup_cache_mode(entry, vma);
up_read(&current->mm->mmap_sem);
return 0; return 0;
} }
#else #else