diff mbox

drm/i915: release mutex in i915_gem_init()'s error path

Message ID 1391181242-19062-1-git-send-email-mika.kuoppala@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kuoppala Jan. 31, 2014, 3:14 p.m. UTC
Found with smatch.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Daniel Vetter Feb. 4, 2014, 11:11 a.m. UTC | #1
On Fri, Jan 31, 2014 at 05:14:02PM +0200, Mika Kuoppala wrote:
> Found with smatch.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>

Both smatch patches merged to dinq, thanks.
-Daniel
Ben Widawsky March 21, 2014, 6:39 p.m. UTC | #2
On Tue, Feb 04, 2014 at 12:11:03PM +0100, Daniel Vetter wrote:
> On Fri, Jan 31, 2014 at 05:14:02PM +0200, Mika Kuoppala wrote:
> > Found with smatch.
> > 
> > Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> 
> Both smatch patches merged to dinq, thanks.
> -Daniel

CC stable?
Daniel Vetter March 21, 2014, 7:27 p.m. UTC | #3
On Fri, Mar 21, 2014 at 11:39:55AM -0700, Ben Widawsky wrote:
> On Tue, Feb 04, 2014 at 12:11:03PM +0100, Daniel Vetter wrote:
> > On Fri, Jan 31, 2014 at 05:14:02PM +0200, Mika Kuoppala wrote:
> > > Found with smatch.
> > > 
> > > Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> > 
> > Both smatch patches merged to dinq, thanks.
> > -Daniel
> 
> CC stable?

Init tends to rarely blow up, so without a report that this is possible in
the wild, nope. Quoting stable kernel rules:

 - It must fix a real bug that bothers people (not a, "This could be a
   problem..." type thing).

Cheers, Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 08331e1..feedef9 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4536,8 +4536,10 @@  int i915_gem_init(struct drm_device *dev)
 	i915_gem_init_global_gtt(dev);
 
 	ret = i915_gem_context_init(dev);
-	if (ret)
+	if (ret) {
+		mutex_unlock(&dev->struct_mutex);
 		return ret;
+	}
 
 	ret = i915_gem_init_hw(dev);
 	mutex_unlock(&dev->struct_mutex);