qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 6/7] xhci: fix address device


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH 6/7] xhci: fix address device
Date: Tue, 16 Apr 2013 12:13:09 +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 <address@hidden>
---
 hw/usb/hcd-xhci.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index e489059..a26b78e 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -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);
-- 
1.7.9.7




reply via email to

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