提交 bf51997c 编写于 作者: C Chris Wilson

drm/i915: Drop mutex after successful kref_put_mutex()

The kref_put_mutex() returns with the mutex held after freeing the
object - so we must remember to drop it...

Fixes: 69df05e1 ("drm/i915: Simplify releasing context reference")
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161219101357.28140-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
上级 f73e7399
......@@ -3520,9 +3520,10 @@ static inline void i915_gem_context_put(struct i915_gem_context *ctx)
static inline void i915_gem_context_put_unlocked(struct i915_gem_context *ctx)
{
kref_put_mutex(&ctx->ref,
i915_gem_context_free,
&ctx->i915->drm.struct_mutex);
struct mutex *lock = &ctx->i915->drm.struct_mutex;
if (kref_put_mutex(&ctx->ref, i915_gem_context_free, lock))
mutex_unlock(lock);
}
static inline struct intel_timeline *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册