summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-02-07 15:43:48 +0300
committerGerd Hoffmann <kraxel@redhat.com>2020-02-10 14:54:32 +0300
commite59a2508d90f393c8423716349db315e32b67559 (patch)
tree0732e8d9ca410fa091f44f63c67bfe94fb234a13
parentcb05ec5886151436e843cf194cfa2c8d4a889a54 (diff)
downloadlinux-e59a2508d90f393c8423716349db315e32b67559.tar.xz
drm/bochs: deinit bugfix
Check whenever mode_config was actually properly initialized before trying to clean it up. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20200207124348.21641-1-kraxel@redhat.com
-rw-r--r--drivers/gpu/drm/bochs/bochs_kms.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index 7410b0ea4623..8066d7d370d5 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -163,6 +163,9 @@ int bochs_kms_init(struct bochs_device *bochs)
void bochs_kms_fini(struct bochs_device *bochs)
{
+ if (!bochs->dev->mode_config.num_connector)
+ return;
+
drm_atomic_helper_shutdown(bochs->dev);
drm_mode_config_cleanup(bochs->dev);
}