qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [PATCH] usb: Fix usb-bt-dongle segfault.


From: Paolo Bonzini
Subject: Re: [Qemu-stable] [PATCH] usb: Fix usb-bt-dongle segfault.
Date: Mon, 16 Jun 2014 11:00:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Il 15/06/2014 23:37, Hani Benhabiles ha scritto:
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);


All lines but the s->hci assignment should be removed from usb_bt_init too.

As to s->hci, I suggest inlining usb_create_simple into usb_bt_init, and
initializing s->hci there before doing the qdev_init() call.

Then here you can wrap the assignment under "if (!s->hci)".

I am afraid I don't quite understand what you want to achieve with this and why.

Could you please explain how is usb_bt_init() relevant to this case ?

usb_bt_init() ends up calling usb_bt_initfn(), via usb_create_simple. So if you add code to usb_bt_initfn() you can remove the corresponding lines in usb_bt_init().

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]