BackMerge tag 'v6.5-rc7' into drm-next
[linux-2.6-block.git] / drivers / gpu / drm / drm_gem_shmem_helper.c
index a783d2245599eeadbb80d91785c4bcdfc1f75e9b..e435f986cd135bffb87bc93cf643e563c927eba2 100644 (file)
@@ -594,7 +594,13 @@ int drm_gem_shmem_mmap(struct drm_gem_shmem_object *shmem, struct vm_area_struct
        int ret;
 
        if (obj->import_attach) {
+               /* Reset both vm_ops and vm_private_data, so we don't end up with
+                * vm_ops pointing to our implementation if the dma-buf backend
+                * doesn't set those fields.
+                */
                vma->vm_private_data = NULL;
+               vma->vm_ops = NULL;
+
                ret = dma_buf_mmap(obj->dma_buf, vma, 0);
 
                /* Drop the reference drm_gem_mmap_obj() acquired.*/