From: Maarten Lankhorst Date: Wed, 9 Sep 2015 11:46:21 +0000 (+0200) Subject: drm/core: Do not call drm_framebuffer_remove internally during teardown. X-Git-Tag: v4.4~243^2~34^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c099b55a6fa6f9ec2f26105c76df462d7c7c7d5b;p=platform%2Fkernel%2Flinux-amlogic.git drm/core: Do not call drm_framebuffer_remove internally during teardown. 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 Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 474f328..9b9c4b4 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -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,