drm/qxl: release shadow on shutdown
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 4 Feb 2021 14:57:06 +0000 (15:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:22 +0000 (14:47 +0200)
[ Upstream commit 4ca77c513537700d3fae69030879f781dde1904c ]

In case we have a shadow surface on shutdown release
it so it doesn't leak.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: http://patchwork.freedesktop.org/patch/msgid/20210204145712.1531203-6-kraxel@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/qxl/qxl_display.c

index 862ef59d4d03345224460cd05faa10921fc86a3b..1f0802f5d84ef29f05a1d5644e9580ffa4f5e247 100644 (file)
@@ -1224,6 +1224,10 @@ int qxl_modeset_init(struct qxl_device *qdev)
 
 void qxl_modeset_fini(struct qxl_device *qdev)
 {
+       if (qdev->dumb_shadow_bo) {
+               drm_gem_object_put(&qdev->dumb_shadow_bo->tbo.base);
+               qdev->dumb_shadow_bo = NULL;
+       }
        qxl_destroy_monitors_object(qdev);
        drm_mode_config_cleanup(&qdev->ddev);
 }