Message ID | 149995469805.29380.5405466287939095053@mail.alporthouse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 8dc11064253d..3118aed844f1 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -826,7 +826,6 @@ drm_gem_object_put_unlocked(struct drm_gem_object *obj) return; dev = obj->dev; - might_lock(&dev->struct_mutex); if (dev->driver->gem_free_object_unlocked) kref_put(&obj->refcount, drm_gem_object_free); diff --git a/include/linux/kref.h b/include/linux/kref.h index 29220724bf1c..4b1133cd5d20 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h @@ -77,6 +77,8 @@ static inline int kref_put_mutex(struct kref *kref, void (*release)(struct kref *kref), struct mutex *lock) { + might_lock(lock); + if (refcount_dec_and_mutex_lock(&kref->refcount, lock)) { release(kref); return 1;