Skip to content

Commit

Permalink
xhci: fix overflow in usb_xhci_post_load
Browse files Browse the repository at this point in the history
Found by Coverity.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
kraxel committed Feb 18, 2014
1 parent bd93976 commit f6969b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/usb/hcd-xhci.c
Expand Up @@ -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;
Expand Down

0 comments on commit f6969b9

Please sign in to comment.