OSDN Git Service

drm/i915: Add a couple of missing i915_active_fini()
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 31 Jul 2020 08:50:09 +0000 (09:50 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Mon, 17 Aug 2020 20:16:34 +0000 (16:16 -0400)
We use i915_active_fini() as a debug check on the i915_active state
before freeing. If we forget to call it, we may end up angering the
debugobjects contained within.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200731085015.32368-1-chris@chris-wilson.co.uk
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/display/intel_frontbuffer.c
drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c

index 2979ed2..d898b37 100644 (file)
@@ -232,6 +232,8 @@ static void frontbuffer_release(struct kref *ref)
        RCU_INIT_POINTER(obj->frontbuffer, NULL);
        spin_unlock(&to_i915(obj->base.dev)->fb_tracking.lock);
 
+       i915_active_fini(&front->write);
+
        i915_gem_object_put(obj);
        kfree_rcu(front, rcu);
 }
index 73243ba..e73854d 100644 (file)
@@ -47,7 +47,10 @@ static int pulse_active(struct i915_active *active)
 
 static void pulse_free(struct kref *kref)
 {
-       kfree(container_of(kref, struct pulse, kref));
+       struct pulse *p = container_of(kref, typeof(*p), kref);
+
+       i915_active_fini(&p->active);
+       kfree(p);
 }
 
 static void pulse_put(struct pulse *p)