drm/msm: unlock on error in msm_gem_get_iova()

We recently added locking to this function but there was a direct return
that was overlooked where we need to unlock.

Fixes: 0e08270a1f ("drm/msm: Separate locking of buffer resources from struct_mutex")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Dan Carpenter
2017-07-10 10:20:42 +03:00
committed by Rob Clark
parent 65e9310889
commit 71e3dfa167

View File

@@ -383,8 +383,10 @@ int msm_gem_get_iova(struct drm_gem_object *obj,
struct page **pages; struct page **pages;
vma = add_vma(obj, aspace); vma = add_vma(obj, aspace);
if (IS_ERR(vma)) if (IS_ERR(vma)) {
return PTR_ERR(vma); ret = PTR_ERR(vma);
goto unlock;
}
pages = get_pages(obj); pages = get_pages(obj);
if (IS_ERR(pages)) { if (IS_ERR(pages)) {
@@ -405,7 +407,7 @@ int msm_gem_get_iova(struct drm_gem_object *obj,
fail: fail:
del_vma(vma); del_vma(vma);
unlock:
mutex_unlock(&msm_obj->lock); mutex_unlock(&msm_obj->lock);
return ret; return ret;
} }