diff mbox series

[5/6] xhci: fix guest triggerable assert

Message ID 20201105134112.25119-6-kraxel@redhat.com
State Accepted
Commit 22abfc96af0209fa58a7b9c13d60b2982db281c7
Headers show
Series usb: fix some guest-triggerable asserts | expand

Commit Message

Gerd Hoffmann Nov. 5, 2020, 1:41 p.m. UTC
We didn't start any work yet so we can just return
at that point instead of asserting.

Buglink: https://bugs.launchpad.net/qemu/+bug/1883732
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-xhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Nov. 5, 2020, 2:28 p.m. UTC | #1
On 11/5/20 2:41 PM, Gerd Hoffmann wrote:
> We didn't start any work yet so we can just return

> at that point instead of asserting.

> 

> Buglink: https://bugs.launchpad.net/qemu/+bug/1883732

> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

> ---

>  hw/usb/hcd-xhci.c | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)


Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 79ce5c4be6c4..d00bb0141dac 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1904,7 +1904,9 @@  static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
         streamid = 0;
         xhci_set_ep_state(xhci, epctx, NULL, EP_RUNNING);
     }
-    assert(ring->dequeue != 0);
+    if (!ring->dequeue) {
+        return;
+    }
 
     epctx->kick_active++;
     while (1) {