mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 14:48:06 +00:00
drm/tegra: Don't take dev->struct_mutex 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). v2: Finally get rid of the copypasta from another commit in this commit message. And convert to _unlocked like we need to (Patrik). Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: Thierry Reding <thierry.reding@gmail.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
115333042c
commit
d849c82fac
1 changed files with 1 additions and 6 deletions
|
@ -408,12 +408,9 @@ int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
|
|||
struct drm_gem_object *gem;
|
||||
struct tegra_bo *bo;
|
||||
|
||||
mutex_lock(&drm->struct_mutex);
|
||||
|
||||
gem = drm_gem_object_lookup(drm, file, handle);
|
||||
if (!gem) {
|
||||
dev_err(drm->dev, "failed to lookup GEM object\n");
|
||||
mutex_unlock(&drm->struct_mutex);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -421,9 +418,7 @@ int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
|
|||
|
||||
*offset = drm_vma_node_offset_addr(&bo->gem.vma_node);
|
||||
|
||||
drm_gem_object_unreference(gem);
|
||||
|
||||
mutex_unlock(&drm->struct_mutex);
|
||||
drm_gem_object_unreference_unlocked(gem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue