diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-15 00:02:36 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-08-19 02:47:37 +0200 |
commit | 1216f732379151cd581444e385a8266d0b54549d (patch) | |
tree | 4bb20e8000b08255a46f9be345f00099eb6d333d /drivers/gpu/drm/drm_gem.c | |
parent | drm/gem: remove bogus NULL check from drm_gem_object_handle_unreference_unlocked (diff) | |
download | linux-1216f732379151cd581444e385a8266d0b54549d.tar.xz linux-1216f732379151cd581444e385a8266d0b54549d.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/drm_gem.c')
-rw-r--r-- | drivers/gpu/drm/drm_gem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 44978bcf8125..dcbd2f559e39 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -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; /* |