diff options
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_gem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 973eb8805ce0..f716308fb48c 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -804,12 +804,13 @@ drm_gem_object_free(struct kref *kref) container_of(kref, struct drm_gem_object, refcount); struct drm_device *dev = obj->dev; - WARN_ON(!mutex_is_locked(&dev->struct_mutex)); - - if (dev->driver->gem_free_object_unlocked) + if (dev->driver->gem_free_object_unlocked) { dev->driver->gem_free_object_unlocked(obj); - else if (dev->driver->gem_free_object) + } else if (dev->driver->gem_free_object) { + WARN_ON(!mutex_is_locked(&dev->struct_mutex)); + dev->driver->gem_free_object(obj); + } } EXPORT_SYMBOL(drm_gem_object_free); |