summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_active.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-08-19 08:58:22 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-08-19 16:41:19 +0100
commite1d7b66b815a542114169609c8f1b4e46856d7be (patch)
tree51bc39448c512beec5f120c080aa09d80a11ee06 /drivers/gpu/drm/i915/i915_active.c
parent5a6b7ef69e3d9807aa9b38d9098772ae05916de5 (diff)
drm/i915: i915_active.retire() is optional
Check that i915_active.retire() exists before calling. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190819075835.20065-6-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_active.c')
-rw-r--r--drivers/gpu/drm/i915/i915_active.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c
index df6164591702..48e16ad93bbd 100644
--- a/drivers/gpu/drm/i915/i915_active.c
+++ b/drivers/gpu/drm/i915/i915_active.c
@@ -142,12 +142,14 @@ __active_retire(struct i915_active *ref)
if (!retire)
return;
- ref->retire(ref);
-
rbtree_postorder_for_each_entry_safe(it, n, &root, node) {
GEM_BUG_ON(i915_active_request_isset(&it->base));
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