From: Daniel Vetter Date: Wed, 14 Aug 2013 22:02:36 +0000 (+0200) Subject: drm/gem: WARN about unbalanced handle refcounts X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1216f732379151cd581444e385a8266d0b54549d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Dave Airlie --- 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; /*