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]>
(cherry picked from commit 7b1eba96aecac32d186d4c16b81c7b4681186844)
Signed-off-by: Michael Tokarev <[email protected]>
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 2974819a2da..9ec9d8a462e 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -747,11 +747,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.47.3