Skip to content

Commit

Permalink
drm: Fixup locking WARN_ON mistake around gem_object_free_unlocked
Browse files Browse the repository at this point in the history
Embarrassingly while fixing up the old paths for i915 I managed to
misplace a locking check for the new _unlocked paths. That's what I
get for not retesting on radeon.

Fixes: 9f0ba53 ("drm/gem: support BO freeing without dev->struct_mutex")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
  • Loading branch information
Daniel Vetter committed May 4, 2016
1 parent 1d657c5 commit 6d3e7fd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/gpu/drm/drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 6d3e7fd

Please sign in to comment.