From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WumHi-0005oh-Cg for qemu-devel@nongnu.org; Wed, 11 Jun 2014 13:26:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WumHT-0002YA-1j for qemu-devel@nongnu.org; Wed, 11 Jun 2014 13:26:02 -0400 From: Hani Benhabiles Date: Wed, 11 Jun 2014 18:25:36 +0100 Message-Id: <1402507536-15437-1-git-send-email-kroosec@gmail.com> Subject: [Qemu-devel] [PATCH] usb: Fix usb-bt-dongle segfault. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, qemu-stable@nongnu.org Due to an incomplete initialization, adding a usb-bt-dongle device through HMP or QMP will cause a segmentation fault. Signed-off-by: Hani Benhabiles --- Not sure about the exact policy of qemu-stable. CC'ing it as this bug results in a segfault. hw/usb/dev-bluetooth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c index a9661d2..6d02343 100644 --- a/hw/usb/dev-bluetooth.c +++ b/hw/usb/dev-bluetooth.c @@ -506,6 +506,12 @@ static int usb_bt_initfn(USBDevice *dev) usb_desc_create_serial(dev); usb_desc_init(dev); + s->dev.opaque = s; + s->hci = bt_new_hci(qemu_find_bt_vlan(0)); + s->hci->opaque = s; + s->hci->evt_recv = usb_bt_out_hci_packet_event; + s->hci->acl_recv = usb_bt_out_hci_packet_acl; + usb_bt_handle_reset(&s->dev); s->intr = usb_ep_get(dev, USB_TOKEN_IN, USB_EVT_EP); return 0; -- 1.8.3.2