Skip to content

Commit

Permalink
drm/gem: WARN about unbalanced handle refcounts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Vetter authored and Dave Airlie committed Aug 19, 2013
1 parent 6bc505b commit 1216f73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 1216f73

Please sign in to comment.