Message ID | 20200403011318.2280-1-sultan@kerneltoast.com |
---|---|
State | New |
Headers | show |
Series | drm/i915: Fix use-after-free due to intel_context_pin/unpin race | expand |
diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c index c4048628188a..0478bcf061b5 100644 --- a/drivers/gpu/drm/i915/i915_active.c +++ b/drivers/gpu/drm/i915/i915_active.c @@ -148,8 +148,10 @@ __active_retire(struct i915_active *ref) spin_unlock_irqrestore(&ref->tree_lock, flags); /* After the final retire, the entire struct may be freed */ + mutex_lock(&ref->mutex); if (ref->retire) ref->retire(ref); + mutex_unlock(&ref->mutex); /* ... except if you wait on it, you must manage your own references! */ wake_up_var(ref);