qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 6/7] xhci: fix address device
Date: Tue, 16 Apr 2013 12:13:09 +0200	[thread overview]
Message-ID: <1366107190-30853-7-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1366107190-30853-1-git-send-email-kraxel@redhat.com>

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 |    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

  parent reply	other threads:[~2013-04-16 10:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 10:13 [Qemu-devel] [PULL 0/7] usb patch queue Gerd Hoffmann
2013-04-16 10:13 ` [Qemu-devel] [PATCH 1/7] usb-serial: Remove double call to qemu_chr_add_handlers( NULL ) Gerd Hoffmann
2013-04-16 10:13 ` [Qemu-devel] [PATCH 2/7] xhci: remove leftover debug printf Gerd Hoffmann
2013-04-16 10:13 ` [Qemu-devel] [PATCH 3/7] xhci: add xhci_cap_write Gerd Hoffmann
2013-04-16 10:13 ` [Qemu-devel] [PATCH 4/7] xhci: fix portsc writes Gerd Hoffmann
2013-04-16 10:13 ` [Qemu-devel] [PATCH 5/7] xhci: use slotid as device address Gerd Hoffmann
2013-04-16 10:13 ` Gerd Hoffmann [this message]
2013-04-16 10:13 ` [Qemu-devel] [PATCH 7/7] use libusb for usb-host Gerd Hoffmann
2013-04-18 13:07   ` Markus Armbruster
2013-04-22 15:57     ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366107190-30853-7-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).