projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f73e739
)
drm/i915: Drop mutex after successful kref_put_mutex()
author
Chris Wilson
<chris@chris-wilson.co.uk>
Mon, 19 Dec 2016 10:13:57 +0000
(10:13 +0000)
committer
Chris Wilson
<chris@chris-wilson.co.uk>
Mon, 19 Dec 2016 11:42:31 +0000
(11:42 +0000)
The kref_put_mutex() returns with the mutex held after freeing the
object - so we must remember to drop it...
Fixes:
69df05e11ab8
("drm/i915: Simplify releasing context reference")
Signed-off-by: Chris 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.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_drv.h
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/i915/i915_drv.h
b/drivers/gpu/drm/i915/i915_drv.h
index
202a6ac
..
785e04c
100644
(file)
--- a/
drivers/gpu/drm/i915/i915_drv.h
+++ b/
drivers/gpu/drm/i915/i915_drv.h
@@
-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 *