aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-01-29 17:03:10 +0100
committerGerd Hoffmann <kraxel@redhat.com>2014-02-18 15:39:12 +0100
commitf6969b9fef543da1ffa975d24f4d7b75dc369b03 (patch)
treecad1839e9446e9498830c66d376620cd3ff9abb2 /hw
parentbd93976a1ad9cca9636da66dfde98a41e573130c (diff)
xhci: fix overflow in usb_xhci_post_load
Found by Coverity. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/hcd-xhci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 0fa814ee09..8d9cfe8810 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;