Skip to contentSkip to conversation

usb-ehci: drop assert()

PATCH In review Gerd Hoffmann 2 participants 2 messages Mar 30, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb-ehci: drop assert()

Not sure what the purpose of the assert() was, in any case it is bogous. We can arrive there if transfer descriptors passed to us from the guest failed to pass sanity checks, i.e. it is guest-triggerable. We deal with that case by resetting the host controller. Everything is ok, no need to throw a core dump here.

---
 hw/usb/hcd-ehci.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
hw/usb/hcd-ehci.c +0 -1
index e12f098..23631a4 100644
@@ -2009,7 +2009,6 @@ static void ehci_advance_state(EHCIState *ehci,
             fprintf(stderr, "processing error - resetting ehci HC\n");
             ehci_reset(ehci);
             again = 0;
-            assert(0);
         }
     }
     while (again);
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw

Looks good, ACK.

Quoted 23 lines · Gerd Hoffmann

Not sure what the purpose of the assert() was, in any case it is bogous. We can arrive there if transfer descriptors passed to us from the guest failed to pass sanity checks, i.e. it is guest-triggerable. We deal with that case by resetting the host controller. Everything is ok, no need to throw a core dump here.

---
  hw/usb/hcd-ehci.c |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)
hw/usb/hcd-ehci.c +0 -1
index e12f098..23631a4 100644
@@ -2009,7 +2009,6 @@ static void ehci_advance_state(EHCIState *ehci,
              fprintf(stderr, "processing error - resetting ehci HC\n");
              ehci_reset(ehci);
              again = 0;
-            assert(0);
          }
      }
      while (again);