drm/exynos: Drop dev->struct_mutex from mmap offset function
Simply forgotten about this when I was doing my general cleansing of simple gem mmap offset functions. There's nothing but core functions called here, and they all have their own protection already. Aside: DRM_ERROR for userspace controlled input isn't great, but that's for another patch. v2: Use _unlocked unreference (Daniel Stone). Cc: Daniel Stone <daniel@fooishbar.org> Cc: Inki Dae <inki.dae@samsung.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1459330852-27668-7-git-send-email-daniel.vetter@ffwll.ch
This commit is contained in:
parent
ca25d6b08f
commit
91263622f1
|
@ -458,8 +458,6 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
|
||||||
struct drm_gem_object *obj;
|
struct drm_gem_object *obj;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
mutex_lock(&dev->struct_mutex);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get offset of memory allocated for drm framebuffer.
|
* get offset of memory allocated for drm framebuffer.
|
||||||
* - this callback would be called by user application
|
* - this callback would be called by user application
|
||||||
|
@ -469,16 +467,13 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
|
||||||
obj = drm_gem_object_lookup(dev, file_priv, handle);
|
obj = drm_gem_object_lookup(dev, file_priv, handle);
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
DRM_ERROR("failed to lookup gem object.\n");
|
DRM_ERROR("failed to lookup gem object.\n");
|
||||||
ret = -EINVAL;
|
return -EINVAL;
|
||||||
goto unlock;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*offset = drm_vma_node_offset_addr(&obj->vma_node);
|
*offset = drm_vma_node_offset_addr(&obj->vma_node);
|
||||||
DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset);
|
DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset);
|
||||||
|
|
||||||
drm_gem_object_unreference(obj);
|
drm_gem_object_unreference_unlocked(obj);
|
||||||
unlock:
|
|
||||||
mutex_unlock(&dev->struct_mutex);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue