From: Munkhbaatar Enkhbaatar <[email protected]>
Suggested-by: Peter Maydell <[email protected]>
Signed-off-by: Munkhbaatar Enkhbaatar <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
---
hw/usb/hcd-ohci.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 6ed8046fc2..8f4de0066e 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -746,11 +746,10 @@ static int ohci_service_iso_td(OHCIState *ohci, struct
ohci_ed *ed)
usb_packet_setup(pkt, pid, ep, 0, addr, false, int_req);
usb_packet_addbuf(pkt, buf, len);
usb_handle_packet(dev, pkt);
- if (pkt->status == USB_RET_ASYNC) {
- usb_device_flush_ep_queue(dev, ep);
- g_free(pkt);
- return 1;
- }
+
+ /* The USB core guarantees to never defer ISO TDs. */
+ assert(pkt->status != USB_RET_ASYNC);
+
if (pkt->status == USB_RET_SUCCESS) {
ret = pkt->actual_length;
} else {
--
2.43.0