]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/shmem-helper: Reset vma->vm_ops before calling dma_buf_mmap()
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 24 Jul 2023 11:26:10 +0000 (13:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2023 16:20:59 +0000 (18:20 +0200)
commit188e8e25ae244c6f4622802ab54037b54293aaec
treeaaab15a0d3dd8e172d74d67ced62fab577c6eb38
parent6b6839e440d7ab918d812b65441660f2669d6ffd
drm/shmem-helper: Reset vma->vm_ops before calling dma_buf_mmap()

commit 07dd476f6116966cb2006e25fdcf48f0715115ff upstream.

The dma-buf backend is supposed to provide its own vm_ops, but some
implementation just have nothing special to do and leave vm_ops
untouched, probably expecting this field to be zero initialized (this
is the case with the system_heap implementation for instance).
Let's reset vma->vm_ops to NULL to keep things working with these
implementations.

Fixes: 26d3ac3cb04d ("drm/shmem-helpers: Redirect mmap for imported dma-buf")
Cc: <stable@vger.kernel.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reported-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230724112610.60974-1-boris.brezillon@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_gem_shmem_helper.c