summaryrefslogtreecommitdiffstats
path: root/kernel/include/drm/drm_gem.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/drm/drm_gem.h')
-rw-r--r--kernel/include/drm/drm_gem.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/include/drm/drm_gem.h b/kernel/include/drm/drm_gem.h
index 7a592d7e3..15e7f0073 100644
--- a/kernel/include/drm/drm_gem.h
+++ b/kernel/include/drm/drm_gem.h
@@ -142,8 +142,11 @@ drm_gem_object_reference(struct drm_gem_object *obj)
static inline void
drm_gem_object_unreference(struct drm_gem_object *obj)
{
- if (obj != NULL)
+ if (obj != NULL) {
+ WARN_ON(!mutex_is_locked(&obj->dev->struct_mutex));
+
kref_put(&obj->refcount, drm_gem_object_free);
+ }
}
static inline void