From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US2t2-00061U-LP for qemu-devel@nongnu.org; Tue, 16 Apr 2013 06:13:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US2t0-0003dy-11 for qemu-devel@nongnu.org; Tue, 16 Apr 2013 06:13:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US2sz-0003dN-Pc for qemu-devel@nongnu.org; Tue, 16 Apr 2013 06:13:13 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3GADDei013716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 06:13:13 -0400 From: Gerd Hoffmann Date: Tue, 16 Apr 2013 12:13:09 +0200 Message-Id: <1366107190-30853-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1366107190-30853-1-git-send-email-kraxel@redhat.com> References: <1366107190-30853-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 6/7] xhci: fix address device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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 --- 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