1
0
Fork 0

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: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
hifive-unleashed-5.1
Daniel Vetter 2013-08-15 00:02:36 +02:00 committed by Dave Airlie
parent 6bc505b86a
commit 1216f73237
1 changed files with 1 additions and 1 deletions

View File

@ -238,7 +238,7 @@ static void drm_gem_object_handle_free(struct drm_gem_object *obj)
void
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;
/*