Skip to contentSkip to conversation

xhci: fix overflow in usb_xhci_post_load

PATCH New Gerd Hoffmann 1 participant 1 message Jan 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xhci: fix overflow in usb_xhci_post_load

Found by Coverity.

---
 hw/usb/hcd-xhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/hcd-xhci.c +1 -1
index bafe085..44964f4 100644
@@ -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;
Signature · 1 line
1.8.3.1