drm/i915: avoid deadlock on failure paths in __intel_framebuffer_create()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 7 Nov 2014 22:41:23 +0000 (01:41 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 14 Nov 2014 09:29:12 +0000 (10:29 +0100)
Since a8bb6818270c __intel_framebuffer_create() is called
with struct_mutex held, so it should use drm_gem_object_unreference()
instead of drm_gem_object_unreference_unlocked().

Found by Linux Driver Verification project (linuxtesting.org).

This regression has been introduced in

commit a8bb6818270c32126dba0fd2ddb139d885c5687d
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Feb 10 18:00:39 2014 +0100

    drm/i915: Fix error path leak in fbdev fb allocation

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index 9480a6173d7836877f60f5ed67f7f26cf41da94e..1509ab494f2754436f350a04c1c25d751ba12f7d 100644 (file)
@@ -8421,7 +8421,7 @@ __intel_framebuffer_create(struct drm_device *dev,
 
        intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
        if (!intel_fb) {
-               drm_gem_object_unreference_unlocked(&obj->base);
+               drm_gem_object_unreference(&obj->base);
                return ERR_PTR(-ENOMEM);
        }
 
@@ -8431,7 +8431,7 @@ __intel_framebuffer_create(struct drm_device *dev,
 
        return &intel_fb->base;
 err:
-       drm_gem_object_unreference_unlocked(&obj->base);
+       drm_gem_object_unreference(&obj->base);
        kfree(intel_fb);
 
        return ERR_PTR(ret);
This page took 0.036022 seconds and 5 git commands to generate.