summaryrefslogtreecommitdiff
path: root/ui/spice-display.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-02-19 09:23:03 +0100
committerGerd Hoffmann <kraxel@redhat.com>2016-02-23 12:04:39 +0100
commitb5e751b51f14cffada6be647aa576b79f1755d7e (patch)
treea80f7345e62a3f4648674e09f925d8c83ea68c2a /ui/spice-display.c
parent8eb779e4223a18db9838a49ece1bc72cfdfb7761 (diff)
downloadqemu-b5e751b51f14cffada6be647aa576b79f1755d7e.tar.gz
spice: init dcl before registering qxl interface
Without this spice might callback into qemu before ssd->dcl.con is initialized, resulting in a segfault due to NULL pointer dereference. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'ui/spice-display.c')
-rw-r--r--ui/spice-display.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 8a5b3258bd..cdbc78d81a 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -775,14 +775,14 @@ static void qemu_spice_display_init_one(QemuConsole *con)
qemu_spice_display_init_common(ssd);
+ ssd->dcl.ops = &display_listener_ops;
+ ssd->dcl.con = con;
+
ssd->qxl.base.sif = &dpy_interface.base;
qemu_spice_add_display_interface(&ssd->qxl, con);
assert(ssd->worker);
-
qemu_spice_create_host_memslot(ssd);
- ssd->dcl.ops = &display_listener_ops;
- ssd->dcl.con = con;
register_displaychangelistener(&ssd->dcl);
}