summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-09-11 10:09:17 +0200
committerAlex Deucher <alexander.deucher@amd.com>2017-09-13 18:10:12 +0200
commite97f12f359775de4fabfb507f836ebffa20f4986 (patch)
tree7ffe6d4de9b810551f7f0da34c478ae1de0c91be /drivers/gpu/drm/radeon
parentamdgpu: Only destroy fbdev framebuffer if it was initialized (diff)
downloadlinux-e97f12f359775de4fabfb507f836ebffa20f4986.tar.xz
linux-e97f12f359775de4fabfb507f836ebffa20f4986.zip
radeon: Only destroy fbdev framebuffer if it was initialized
Fixes crash when trying to unload the radeon module before the fbdev framebuffer was initialized, which can happen since the DRM fbdev helper code supports deferred setup. Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index fd25361ac681..2fcf805d3a16 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -322,10 +322,10 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb
if (rfb->obj) {
radeonfb_destroy_pinned_object(rfb->obj);
rfb->obj = NULL;
+ drm_framebuffer_unregister_private(&rfb->base);
+ drm_framebuffer_cleanup(&rfb->base);
}
drm_fb_helper_fini(&rfbdev->helper);
- drm_framebuffer_unregister_private(&rfb->base);
- drm_framebuffer_cleanup(&rfb->base);
return 0;
}