drm/gem: Be more friendly with locking checks
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 9 Jul 2015 21:32:35 +0000 (23:32 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 10 Aug 2015 11:35:49 +0000 (13:35 +0200)
BUG_ON kills the driver, WARN_ON is much friendlier. And usually nothing
bad happens when the locking is slightly busted.

v2: Fix typos in commit message Thierry spotted.

Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
drivers/gpu/drm/drm_gem.c

index 27a4228b43431b05da2fcd3138a9c33ab861d73a..3c2d4abd71c5eb3a82b204f28d8455ddb94a6add 100644 (file)
@@ -766,7 +766,7 @@ drm_gem_object_free(struct kref *kref)
        struct drm_gem_object *obj = (struct drm_gem_object *) kref;
        struct drm_device *dev = obj->dev;
 
-       BUG_ON(!mutex_is_locked(&dev->struct_mutex));
+       WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
        if (dev->driver->gem_free_object != NULL)
                dev->driver->gem_free_object(obj);