]> git.proxmox.com Git - mirror_qemu.git/commitdiff
usb-ehci: add missing usb_packet_init() call
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 19 Apr 2012 11:07:54 +0000 (13:07 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 26 Apr 2012 10:21:15 +0000 (12:21 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/core.c
hw/usb/hcd-ehci.c

index 9a14a5385227035b549e754f59a8bfc458a0227c..0e02da760152672a23d7ac0e371545bbdfd04fd0 100644 (file)
@@ -501,6 +501,7 @@ void usb_packet_set_state(USBPacket *p, USBPacketState state)
 void usb_packet_setup(USBPacket *p, int pid, USBEndpoint *ep)
 {
     assert(!usb_packet_is_inflight(p));
+    assert(p->iov.iov != NULL);
     p->pid = pid;
     p->ep = ep;
     p->result = 0;
index 10a5b158902049a669867b0af9118b950f875158..c6f21ac7b6d92267b568d38437d41eccfe2fadd4 100644 (file)
@@ -664,6 +664,7 @@ static EHCIQueue *ehci_alloc_queue(EHCIState *ehci, int async)
 
     q = g_malloc0(sizeof(*q));
     q->ehci = ehci;
+    usb_packet_init(&q->packet);
     QTAILQ_INSERT_HEAD(head, q, next);
     trace_usb_ehci_queue_action(q, "alloc");
     return q;