]> git.proxmox.com Git - mirror_qemu.git/commitdiff
xhci: fix address device
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 5 Apr 2013 13:18:52 +0000 (15:18 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 16 Apr 2013 10:04:09 +0000 (12:04 +0200)
Zero-initialize the set-address dummy USBPacket,
also add buffer to avoid sanity checks triggering.

https://bugzilla.redhat.com/show_bug.cgi?id=929019

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-xhci.c

index e489059ab8b2099fab95a8b1ef8f551866beac65..a26b78ec880484bb7615e2dee16b455226b21038 100644 (file)
@@ -2139,8 +2139,12 @@ static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid,
         slot_ctx[3] = SLOT_DEFAULT << SLOT_STATE_SHIFT;
     } else {
         USBPacket p;
+        uint8_t buf[1];
+
         slot_ctx[3] = (SLOT_ADDRESSED << SLOT_STATE_SHIFT) | slotid;
         usb_device_reset(dev);
+        memset(&p, 0, sizeof(p));
+        usb_packet_addbuf(&p, buf, sizeof(buf));
         usb_packet_setup(&p, USB_TOKEN_OUT,
                          usb_ep_get(dev, USB_TOKEN_OUT, 0), 0,
                          0, false, false);