diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-07-09 23:32:36 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-08-10 13:36:55 +0200 |
commit | a66b2ea224c40cf341ca2096aad225536aa25956 (patch) | |
tree | dba9161a090599d464f548e5cc2d0d2d6a88cbfb /drivers | |
parent | 8d77a9404ec38be34ffc491a2022022a56e72c90 (diff) | |
download | linux-a66b2ea224c40cf341ca2096aad225536aa25956.tar.gz linux-a66b2ea224c40cf341ca2096aad225536aa25956.tar.bz2 linux-a66b2ea224c40cf341ca2096aad225536aa25956.zip |
drm/ast: 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: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/ast/ast_main.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 035dacc93382..838217f8ce7d 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -571,24 +571,18 @@ ast_dumb_mmap_offset(struct drm_file *file, uint64_t *offset) { struct drm_gem_object *obj; - int ret; struct ast_bo *bo; - mutex_lock(&dev->struct_mutex); obj = drm_gem_object_lookup(dev, file, handle); - if (obj == NULL) { - ret = -ENOENT; - goto out_unlock; - } + if (obj == NULL) + return -ENOENT; bo = gem_to_ast_bo(obj); *offset = ast_bo_mmap_offset(bo); - drm_gem_object_unreference(obj); - ret = 0; -out_unlock: - mutex_unlock(&dev->struct_mutex); - return ret; + drm_gem_object_unreference_unlocked(obj); + + return 0; } |