diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-02-19 09:23:03 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-02-23 12:04:39 +0100 |
commit | b5e751b51f14cffada6be647aa576b79f1755d7e (patch) | |
tree | a80f7345e62a3f4648674e09f925d8c83ea68c2a | |
parent | 8eb779e4223a18db9838a49ece1bc72cfdfb7761 (diff) | |
download | qemu-b5e751b51f14cffada6be647aa576b79f1755d7e.zip qemu-b5e751b51f14cffada6be647aa576b79f1755d7e.tar.gz qemu-b5e751b51f14cffada6be647aa576b79f1755d7e.tar.bz2 |
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>
-rw-r--r-- | ui/spice-display.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c index 8a5b325..cdbc78d 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); } |