Commit 37ae75c8 authored by Daniel Vetter's avatar Daniel Vetter

drm/bochs: Don't grab dev->struct_mutex for in mmap offset ioctl

Since David Herrmann's mmap vma manager rework we don't need to grab
dev->struct_mutex any more to prevent races when looking up the mmap
offset. Drop it and instead don't forget to use the unref_unlocked
variant (since the drm core still cares).
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parent a66b2ea2
...@@ -454,25 +454,17 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, ...@@ -454,25 +454,17 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev,
uint32_t handle, uint64_t *offset) uint32_t handle, uint64_t *offset)
{ {
struct drm_gem_object *obj; struct drm_gem_object *obj;
int ret;
struct bochs_bo *bo; struct bochs_bo *bo;
mutex_lock(&dev->struct_mutex);
obj = drm_gem_object_lookup(dev, file, handle); obj = drm_gem_object_lookup(dev, file, handle);
if (obj == NULL) { if (obj == NULL)
ret = -ENOENT; return -ENOENT;
goto out_unlock;
}
bo = gem_to_bochs_bo(obj); bo = gem_to_bochs_bo(obj);
*offset = bochs_bo_mmap_offset(bo); *offset = bochs_bo_mmap_offset(bo);
drm_gem_object_unreference(obj); drm_gem_object_unreference_unlocked(obj);
ret = 0; return 0;
out_unlock:
mutex_unlock(&dev->struct_mutex);
return ret;
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment