From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REJ9D-0004uV-8H for qemu-devel@nongnu.org; Thu, 13 Oct 2011 07:08:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1REJ9A-0005Fa-5Z for qemu-devel@nongnu.org; Thu, 13 Oct 2011 07:08:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REJ99-0005FE-Te for qemu-devel@nongnu.org; Thu, 13 Oct 2011 07:08:20 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9DB8I4G024194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Oct 2011 07:08:19 -0400 From: Gerd Hoffmann Date: Thu, 13 Oct 2011 13:08:31 +0200 Message-Id: <1318504111-15309-10-git-send-email-kraxel@redhat.com> In-Reply-To: <1318504111-15309-1-git-send-email-kraxel@redhat.com> References: <1318504111-15309-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 9/9] usb-hub: don't trigger assert on packet completion. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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 Signed-off-by: Gerd Hoffmann --- hw/usb-hub.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/usb-hub.c b/hw/usb-hub.c index 39382c7..dab8f51 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) -- 1.7.1