From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYDt8-0006sD-Q6 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYDt4-0001Rc-L5 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYDt4-0001RI-FW for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:26 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 92AD6C000706 for ; Tue, 23 Feb 2016 14:24:25 +0000 (UTC) From: Gerd Hoffmann Date: Tue, 23 Feb 2016 15:24:15 +0100 Message-Id: <1456237462-3687-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1456237462-3687-1-git-send-email-kraxel@redhat.com> References: <1456237462-3687-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 1/8] spice: init dcl before registering qxl interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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 Reviewed-by: Marc-Andr=C3=A9 Lureau --- ui/spice-display.c | 6 +++--- 1 file 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) =20 qemu_spice_display_init_common(ssd); =20 + ssd->dcl.ops =3D &display_listener_ops; + ssd->dcl.con =3D con; + ssd->qxl.base.sif =3D &dpy_interface.base; qemu_spice_add_display_interface(&ssd->qxl, con); assert(ssd->worker); - qemu_spice_create_host_memslot(ssd); =20 - ssd->dcl.ops =3D &display_listener_ops; - ssd->dcl.con =3D con; register_displaychangelistener(&ssd->dcl); } =20 --=20 1.8.3.1