drm/i915: Fix a memory leak with reused mmap_offset
authorjsg <jsg@openbsd.org>
Thu, 2 Feb 2023 04:21:45 +0000 (04:21 +0000)
committerjsg <jsg@openbsd.org>
Thu, 2 Feb 2023 04:21:45 +0000 (04:21 +0000)
From Nirmoy Das
0bdc4b4ba7206c452ee81c82fa66e39d0e1780fb in linux-6.1.y/6.1.9
0220e4fe178c3390eb0291cdb34912d66972db8a in mainline linux

sys/dev/pci/drm/i915/gem/i915_gem_mman.c

index 3a46257..bae805b 100644 (file)
@@ -1038,7 +1038,7 @@ insert:
        GEM_BUG_ON(lookup_mmo(obj, mmap_type) != mmo);
 out:
        if (file)
-               drm_vma_node_allow(&mmo->vma_node, file);
+               drm_vma_node_allow_once(&mmo->vma_node, file);
        return mmo;
 
 err: