diff mbox series

[3/3] drm/i915: don't leak lmem mapping in vma_evict

Message ID 20220610121205.29645-3-juhapekka.heikkila@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/i915/display: Add smem fallback allocation for dpt | expand

Commit Message

Juha-Pekka Heikkila June 10, 2022, 12:12 p.m. UTC
Don't leak lmem mapping in vma_evict, move __i915_vma_iounmap outside
i915_vma_is_map_and_fenceable

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Matthew Auld June 10, 2022, 2:42 p.m. UTC | #1
On Fri, 10 Jun 2022 at 13:12, Juha-Pekka Heikkila
<juhapekka.heikkila@gmail.com> wrote:
>
> Don't leak lmem mapping in vma_evict, move __i915_vma_iounmap outside
> i915_vma_is_map_and_fenceable
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 7753337ff9fb..bda37616221f 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -1918,9 +1918,11 @@  struct dma_fence *__i915_vma_evict(struct i915_vma *vma, bool async)
 		/* release the fence reg _after_ flushing */
 		i915_vma_revoke_fence(vma);
 
-		__i915_vma_iounmap(vma);
 		clear_bit(I915_VMA_CAN_FENCE_BIT, __i915_vma_flags(vma));
 	}
+
+	__i915_vma_iounmap(vma);
+
 	GEM_BUG_ON(vma->fence);
 	GEM_BUG_ON(i915_vma_has_userfault(vma));