Commit 1216f732 authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie

drm/gem: WARN about unbalanced handle refcounts

Trying to drop a reference we don't have is a pretty serious bug.
Trying to paper over it is an even worse offense.

So scream into dmesg with a big WARN in case that ever happens.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6bc505b8
...@@ -238,7 +238,7 @@ static void drm_gem_object_handle_free(struct drm_gem_object *obj) ...@@ -238,7 +238,7 @@ static void drm_gem_object_handle_free(struct drm_gem_object *obj)
void void
drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj) drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
{ {
if (atomic_read(&obj->handle_count) == 0) if (WARN_ON(atomic_read(&obj->handle_count) == 0))
return; return;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment