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 2/7] xhci: fix overflow in usb_xhci_post_load
Date: Tue, 18 Feb 2014 16:50:49 +0100	[thread overview]
Message-ID: <1392738654-4698-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1392738654-4698-1-git-send-email-kraxel@redhat.com>

Found by Coverity.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-xhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 0fa814e..8d9cfe8 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3636,7 +3636,7 @@ static int usb_xhci_post_load(void *opaque, int version_id)
         slot->uport = xhci_lookup_uport(xhci, slot_ctx);
         assert(slot->uport && slot->uport->dev);
 
-        for (epid = 1; epid <= 32; epid++) {
+        for (epid = 1; epid <= 31; epid++) {
             pctx = slot->ctx + 32 * epid;
             xhci_dma_read_u32s(xhci, pctx, ep_ctx, sizeof(ep_ctx));
             state = ep_ctx[0] & EP_STATE_MASK;
-- 
1.8.3.1

  parent reply	other threads:[~2014-02-18 15:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 15:50 [Qemu-devel] [PULL 0/7] usb patch queue Gerd Hoffmann
2014-02-18 15:50 ` [Qemu-devel] [PATCH 1/7] usb: Remove magic constants from device bmAttributes Gerd Hoffmann
2014-02-18 15:50 ` Gerd Hoffmann [this message]
2014-02-18 15:50 ` [Qemu-devel] [PATCH 3/7] uhci: invalidate queue on device address changes Gerd Hoffmann
2014-02-18 15:50 ` [Qemu-devel] [PATCH 4/7] xhci iso: fix time calculation Gerd Hoffmann
2014-02-18 15:50 ` [Qemu-devel] [PATCH 5/7] xhci iso: allow for some latency Gerd Hoffmann
2014-02-18 15:50 ` [Qemu-devel] [PATCH 6/7] xhci: switch debug printf to tracepoint Gerd Hoffmann
2014-02-18 15:50 ` [Qemu-devel] [PATCH 7/7] xhci: use DPRINTF() instead of fprintf(stderr, ...) Gerd Hoffmann
2014-02-20 15:36 ` [Qemu-devel] [PULL 0/7] usb patch queue Peter Maydell

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=1392738654-4698-3-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).