drm/core: Do not call drm_framebuffer_remove internally during teardown.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 9 Sep 2015 11:46:21 +0000 (13:46 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 9 Sep 2015 14:47:45 +0000 (16:47 +0200)
This may cause issues because encoders are already destroyed so removing
active primaries may use freed memory. Instead free the fb directly,
ignoring refcount.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c

index 474f328535a11d22e4d29471f4493cfee1b14861..9b9c4b41422ab57ebdd11da7901b44ef89dcb35b 100644 (file)
@@ -5742,7 +5742,7 @@ void drm_mode_config_cleanup(struct drm_device *dev)
         */
        WARN_ON(!list_empty(&dev->mode_config.fb_list));
        list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
-               drm_framebuffer_remove(fb);
+               drm_framebuffer_free(&fb->refcount);
        }
 
        list_for_each_entry_safe(plane, plt, &dev->mode_config.plane_list,