drm/msm: unlock on error in msm_gem_get_iova()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 10 Jul 2017 07:20:42 +0000 (10:20 +0300)
committerRob Clark <robdclark@gmail.com>
Tue, 1 Aug 2017 20:24:21 +0000 (16:24 -0400)
We recently added locking to this function but there was a direct return
that was overlooked where we need to unlock.

Fixes: 0e08270a1f01 ("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>
drivers/gpu/drm/msm/msm_gem.c

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