OSDN Git Service

qxl: fix segfault
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 24 Nov 2020 12:29:36 +0000 (13:29 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 25 Nov 2020 11:33:21 +0000 (12:33 +0100)
Add missing sanity check.
Reproducer: run qemu with "-device qxl" but without "-spice ..."

Fixes: 0d9b90ce5c73 ("console: make QMP/HMP screendump run in coroutine")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20201124122936.30588-1-kraxel@redhat.com

ui/console.c

index e07d2c3..53dee8e 100644 (file)
@@ -264,7 +264,9 @@ static void gui_setup_refresh(DisplayState *ds)
 
 void graphic_hw_update_done(QemuConsole *con)
 {
-    qemu_co_queue_restart_all(&con->dump_queue);
+    if (con) {
+        qemu_co_queue_restart_all(&con->dump_queue);
+    }
 }
 
 void graphic_hw_update(QemuConsole *con)