public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Sushmita Susheelendra <ssusheel@codeaurora.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Rob Clark <robdclark@gmail.com>, David Airlie <airlied@linux.ie>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/msm: unlock on error in msm_gem_get_iova()
Date: Mon, 10 Jul 2017 17:51:33 +0000	[thread overview]
Message-ID: <4c8833e51fdbb10186786b43e0629204@codeaurora.org> (raw)
In-Reply-To: <20170710072042.fs7ovvp5ufyg5hn3@mwanda>

Thanks for the catch!

-Sushmita

On 2017-07-10 01:20, Dan Carpenter wrote:
> 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>
> 
> diff --git a/drivers/gpu/drm/msm/msm_gem.c 
> b/drivers/gpu/drm/msm/msm_gem.c
> index 65f35544c1ec..065d933df2c3 100644
> --- a/drivers/gpu/drm/msm/msm_gem.c
> +++ b/drivers/gpu/drm/msm/msm_gem.c
> @@ -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;
>  }

      reply	other threads:[~2017-07-10 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10  7:20 [PATCH] drm/msm: unlock on error in msm_gem_get_iova() Dan Carpenter
2017-07-10 17:51 ` Sushmita Susheelendra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c8833e51fdbb10186786b43e0629204@codeaurora.org \
    --to=ssusheel@codeaurora.org \
    --cc=airlied@linux.ie \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox