drm/i915: release mutex in i915_gem_init()'s error path
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Fri, 31 Jan 2014 15:14:02 +0000 (17:14 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 4 Feb 2014 11:10:45 +0000 (12:10 +0100)
Found with smatch.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c

index d230c3bbb4ffb2794e3adf992867399de9593cc6..4054ce47a805e86d9337298da8e6ec1e3ba05230 100644 (file)
@@ -4467,8 +4467,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);