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>
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;
/*