diff mbox

[9/9] usb-hub: don't trigger assert on packet completion.

Message ID 4E96CCDD.5050208@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann Oct. 13, 2011, 11:34 a.m. UTC
Hi,

> -    usb_packet_complete(&s->dev, packet);
> +    s->dev.port->ops->complete(&s->dev.port, packet);

Oops, that doesn't compile.  Got sidetracked wile waiting for the test 
build finish, then forgot to check the results :(

Updated patch attached.  Branch for pulling updated inplace.

cheers,
   Gerd
From 80cf7cf74f29a219e02b50f27c12b1c792ebf99b Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 13 Oct 2011 12:52:47 +0200
Subject: [PATCH] usb-hub: don't trigger assert on packet completion.

Calling usb_packet_complete() recursively when passing up the completion
event up the chain for devices connected via usb hub will trigger an
assert.  So don't do that, make the usb hub emulation call the upstream
completion callback directly instead.

Based on a patch from Stefan Hajnoczi <stefanha@gmail.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb-hub.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 39382c7..09c6516 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -207,10 +207,14 @@  static void usb_hub_complete(USBPort *port, USBPacket *packet)
     /*
      * Just pass it along upstream for now.
      *
-     * If we ever inplement usb 2.0 split transactions this will
+     * If we ever implement usb 2.0 split transactions this will
      * become a little more complicated ...
+     *
+     * Can't use usb_packet_complete() here because packet->owner is
+     * cleared already, go call the ->complete() callback directly
+     * instead.
      */
-    usb_packet_complete(&s->dev, packet);
+    s->dev.port->ops->complete(s->dev.port, packet);
 }
 
 static void usb_hub_handle_reset(USBDevice *dev)