diff options
| author | Christian König <[email protected]> | 2020-09-14 13:09:33 +0000 |
|---|---|---|
| committer | Christian König <[email protected]> | 2020-11-19 09:36:36 +0000 |
| commit | 295992fb815e791d14b18ef7cdbbaf1a76211a31 (patch) | |
| tree | 2b72922a11a0abd63cb11969d3fd5cd7d2874e1c /drivers/gpu/drm/omapdrm/omap_gem.c | |
| parent | mm: mmap: fix fput in error path v2 (diff) | |
| download | kernel-295992fb815e791d14b18ef7cdbbaf1a76211a31.tar.gz kernel-295992fb815e791d14b18ef7cdbbaf1a76211a31.zip | |
mm: introduce vma_set_file function v5
Add the new vma_set_file() function to allow changing
vma->vm_file with the necessary refcount dance.
v2: add more users of this.
v3: add missing EXPORT_SYMBOL, rebase on mmap cleanup,
add comments why we drop the reference on two occasions.
v4: make it clear that changing an anonymous vma is illegal.
v5: move vma_set_file to mm/util.c
Signed-off-by: Christian König <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]> (v2)
Reviewed-by: Jason Gunthorpe <[email protected]>
Acked-by: Andrew Morton <[email protected]>
Link: https://patchwork.freedesktop.org/patch/399360/
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_gem.c')
| -rw-r--r-- | drivers/gpu/drm/omapdrm/omap_gem.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 68c271f4250b..30d299ca8795 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -564,9 +564,8 @@ int omap_gem_mmap_obj(struct drm_gem_object *obj, * address_space (so unmap_mapping_range does what we want, * in particular in the case of mmap'd dmabufs) */ - fput(vma->vm_file); vma->vm_pgoff = 0; - vma->vm_file = get_file(obj->filp); + vma_set_file(vma, obj->filp); vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); } |
