summaryrefslogtreecommitdiff
path: root/hw/usb/dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/dump.c')
-rw-r--r--hw/usb/dump.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/usb/dump.c b/hw/usb/dump.c
index bff9bcd601..4c6445e379 100644
--- a/hw/usb/dump.c
+++ b/hw/usb/dump.c
@@ -157,8 +157,10 @@ static uint8_t get_ep_interval(USBEndpoint *ep)
assert(ep->ifnum < dev->ninterfaces);
const USBDescIface *iface = dev->ifaces[ep->ifnum];
- assert(ep->nr < iface->bNumEndpoints);
- const USBDescEndpoint *uep = iface->eps + ep->nr;
+ /* EP0 is defined as the Default control pipe */
+ assert(ep->nr > 0);
+ assert(ep->nr <= iface->bNumEndpoints);
+ const USBDescEndpoint *uep = iface->eps + ep->nr - 1;
return uep->bInterval;
}