qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hani Benhabiles <kroosec@gmail.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com, qemu-stable@nongnu.org
Subject: [Qemu-devel] [PATCH] usb: Fix usb-bt-dongle segfault.
Date: Wed, 11 Jun 2014 18:25:36 +0100	[thread overview]
Message-ID: <1402507536-15437-1-git-send-email-kroosec@gmail.com> (raw)

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 <hani@linux.com>
---

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

             reply	other threads:[~2014-06-11 17:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 17:25 Hani Benhabiles [this message]
2014-06-11 18:58 ` [Qemu-devel] [PATCH] usb: Fix usb-bt-dongle segfault Paolo Bonzini
2014-06-15 21:37   ` Hani Benhabiles
2014-06-16  9:00     ` Paolo Bonzini
2014-06-17 22:53       ` Hani Benhabiles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402507536-15437-1-git-send-email-kroosec@gmail.com \
    --to=kroosec@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).