]> Git Repo - qemu.git/commitdiff
ohci: don't die on ED_LINK_LIMIT overflow
authorLaurent Vivier <[email protected]>
Thu, 21 Mar 2019 08:52:12 +0000 (09:52 +0100)
committerGerd Hoffmann <[email protected]>
Tue, 26 Mar 2019 11:01:45 +0000 (12:01 +0100)
Stop processing the descriptor list instead. The next frame timer tick will
resume the work

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1686705
Suggested-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
Message-id: 20190321085212[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
hw/usb/hcd-ohci.c

index 196a9f72002d0ed5d8796c9a75e6661fbd17ef4c..81cf5ab7a5a76c12aef357107fd084abe99c6989 100644 (file)
@@ -1200,7 +1200,7 @@ static int ohci_service_ed_list(OHCIState *ohci, uint32_t head, int completion)
     if (head == 0)
         return 0;
 
-    for (cur = head; cur; cur = next_ed) {
+    for (cur = head; cur && link_cnt++ < ED_LINK_LIMIT; cur = next_ed) {
         if (ohci_read_ed(ohci, cur, &ed)) {
             trace_usb_ohci_ed_read_error(cur);
             ohci_die(ohci);
@@ -1209,11 +1209,6 @@ static int ohci_service_ed_list(OHCIState *ohci, uint32_t head, int completion)
 
         next_ed = ed.next & OHCI_DPTR_MASK;
 
-        if (++link_cnt > ED_LINK_LIMIT) {
-            ohci_die(ohci);
-            return 0;
-        }
-
         if ((ed.head & OHCI_ED_H) || (ed.flags & OHCI_ED_K)) {
             uint32_t addr;
             /* Cancel pending packets for ED that have been paused.  */
This page took 0.028679 seconds and 4 git commands to generate.