LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jeremiah Mahler <jmmahler@gmail.com>
To: weiyj_lk@163.com
Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] drm/i915: Fix missing unlock on error in i915_gem_init_hw()
Date: Thu, 4 Dec 2014 17:39:11 -0800	[thread overview]
Message-ID: <20141205013911.GA1510@hudson.localdomain> (raw)
In-Reply-To: <1417740959-342-1-git-send-email-weiyj_lk@163.com>

Wei Yongjun,

On Fri, Dec 05, 2014 at 08:55:59AM +0800, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing unlock before return from function i915_gem_init_hw()
> in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/gpu/drm/i915/i915_gem.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index d2ba315..3eeb2d0 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4879,8 +4879,10 @@ i915_gem_init_hw(struct drm_device *dev)
>  	i915_gem_init_swizzling(dev);
>  
>  	ret = dev_priv->gt.init_rings(dev);
> -	if (ret)
> +	if (ret) {
> +		mutex_unlock(&dev->struct_mutex);
>  		return ret;
> +	}
>  

There are other places in i915_gem_init_hw() where it returns without
unlocking the mutex.  Why is it only necessary here and not any of the
other places?

>  	for (i = 0; i < NUM_L3_SLICES(dev); i++)
>  		i915_gem_l3_remap(&dev_priv->ring[RCS], i);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
- Jeremiah Mahler

  reply	other threads:[~2014-12-05  1:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05  0:55 weiyj_lk
2014-12-05  1:39 ` Jeremiah Mahler [this message]
2014-12-05 12:17   ` Jani Nikula
2014-12-05 12:17   ` Jani Nikula
2014-12-05 12:17     ` [PATCH] drm/i915: release struct_mutex on the i915_gem_init_hw fail path Jani Nikula
2014-12-05 13:03       ` Jeremiah Mahler
2014-12-05 14:04         ` [Intel-gfx] " Daniel Vetter
2014-12-05 13:21 ` [Intel-gfx] [PATCH -next] drm/i915: Fix missing unlock on error in i915_gem_init_hw() Daniel Vetter

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=20141205013911.GA1510@hudson.localdomain \
    --to=jmmahler@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weiyj_lk@163.com \
    --subject='Re: [PATCH -next] drm/i915: Fix missing unlock on error in i915_gem_init_hw()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).