提交 26fe1f4c 编写于 作者: G Gerd Hoffmann

drm/qxl: properly handle device init failures

Specifically do not try release resources which where
not allocated in the first place.

Cc: Tong Zhang <ztong0001@gmail.com>
Tested-by: NTong Zhang <ztong0001@gmail.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Acked-by: NThomas Zimmermann <tzimmermann@suse.de>
Link: http://patchwork.freedesktop.org/patch/msgid/20210217123213.2199186-2-kraxel@redhat.com
上级 def26cd4
......@@ -1183,6 +1183,9 @@ int qxl_destroy_monitors_object(struct qxl_device *qdev)
{
int ret;
if (!qdev->monitors_config_bo)
return 0;
qdev->monitors_config = NULL;
qdev->ram_header->monitors_config = 0;
......
......@@ -288,6 +288,10 @@ void qxl_device_fini(struct qxl_device *qdev)
{
int cur_idx;
/* check if qxl_device_init() was successful (gc_work is initialized last) */
if (!qdev->gc_work.func)
return;
for (cur_idx = 0; cur_idx < 3; cur_idx++) {
if (!qdev->current_release_bo[cur_idx])
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册