Skip to contentSkip to conversation

xhci: fix guest-triggerable assert

PATCH New Gerd Hoffmann 1 participant 1 message Jul 2, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xhci: fix guest-triggerable assert

Set xhci into error state instead of throwing a core dump.

---
 hw/usb/hcd-xhci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
hw/usb/hcd-xhci.c +6 -1
index 721beb5486..8f1a01a405 100644
@@ -1954,7 +1954,12 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
         for (i = 0; i < length; i++) {
             TRBType type;
             type = xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL);
-            assert(type);
+            if (!type) {
+                xhci_die(xhci);
+                xhci_ep_free_xfer(xfer);
+                epctx->kick_active--;
+                return;
+            }
         }
         xfer->streamid = streamid;
 
Signature · 1 line
2.9.3