drm/i915: Assert that the handle->vma lut is empty on object close
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 22 Aug 2017 11:05:16 +0000 (12:05 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 24 Aug 2017 14:22:46 +0000 (15:22 +0100)
Make sure that we are not leaking an entry in the ctx->handles_lut by
asserting that the object was removed prior to being freed. This should
be enforced by all such handles being removed by i915_gem_close_object.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20170822110517.22277-2-chris@chris-wilson.co.uk
Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
drivers/gpu/drm/i915/i915_gem.c

index 3ed9fb0921e2b46039aa78e288439bc1f6ddecfe..5dc396c20c063ecf61f0a7a1ef50f53ec0b5c9b5 100644 (file)
@@ -4416,6 +4416,7 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,
        llist_for_each_entry_safe(obj, on, freed, freed) {
                GEM_BUG_ON(obj->bind_count);
                GEM_BUG_ON(atomic_read(&obj->frontbuffer_bits));
+               GEM_BUG_ON(!list_empty(&obj->lut_list));
 
                if (obj->ops->release)
                        obj->ops->release(obj);