[3/3] drm/i915: be more paranoid with the flink name refcounting
diff mbox

Message ID 1343032047-5713-3-git-send-email-daniel.vetter@ffwll.ch
State New, archived
Headers show

Commit Message

Daniel Vetter July 23, 2012, 8:27 a.m. UTC
We should _never_ call handle_unref without having a name handle.
Doing so would be a bug, so yell around about if this happens with a
loud WARN_ON.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 include/drm/drmP.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 3837e69..d94c6bd 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1677,7 +1677,7 @@  drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
 	if (obj == NULL)
 		return;
 
-	if (atomic_read(&obj->handle_count) == 0)
+	if (WARN_ON(atomic_read(&obj->handle_count) == 0))
 		return;
 
 	/*