Commit e1d7b66b authored by Chris Wilson's avatar Chris Wilson

drm/i915: i915_active.retire() is optional

Check that i915_active.retire() exists before calling.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190819075835.20065-6-chris@chris-wilson.co.uk
parent 5a6b7ef6
...@@ -142,12 +142,14 @@ __active_retire(struct i915_active *ref) ...@@ -142,12 +142,14 @@ __active_retire(struct i915_active *ref)
if (!retire) if (!retire)
return; return;
ref->retire(ref);
rbtree_postorder_for_each_entry_safe(it, n, &root, node) { rbtree_postorder_for_each_entry_safe(it, n, &root, node) {
GEM_BUG_ON(i915_active_request_isset(&it->base)); GEM_BUG_ON(i915_active_request_isset(&it->base));
kmem_cache_free(global.slab_cache, it); kmem_cache_free(global.slab_cache, it);
} }
/* After the final retire, the entire struct may be freed */
if (ref->retire)
ref->retire(ref);
} }
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment