From patchwork Tue Jun 14 11:24:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1898 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.47.109) by localhost6.localdomain6 with IMAP4-SSL; 14 Jun 2011 16:46:31 -0000 Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs56408vdc; Tue, 14 Jun 2011 04:24:08 -0700 (PDT) Received: by 10.227.199.68 with SMTP id er4mr6137753wbb.47.1308050648041; Tue, 14 Jun 2011 04:24:08 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id ej18si15014858wbb.60.2011.06.14.04.24.07 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2011 04:24:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QWRj2-0001Cz-JJ; Tue, 14 Jun 2011 12:24:04 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Gerd Hoffmann Subject: [PATCH] hw/usb-musb.c: Don't misuse usb_packet_complete() Date: Tue, 14 Jun 2011 12:24:04 +0100 Message-Id: <1308050644-4622-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In musb_packet() handle final processing of non-asynchronous USB packets by directly calling musb_schedule_cb() rather than going through usb_packet_complete(). The latter will trigger an assertion because the packet doesn't belong to a device. Signed-off-by: Peter Maydell --- The fix here is as suggested by Gerd. hw/usb-musb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/usb-musb.c b/hw/usb-musb.c index 6037193..3eed855 100644 --- a/hw/usb-musb.c +++ b/hw/usb-musb.c @@ -611,7 +611,7 @@ static void musb_packet(MUSBState *s, MUSBEndPoint *ep, } ep->status[dir] = ret; - usb_packet_complete(s->port.dev, &ep->packey[dir].p); + musb_schedule_cb(s->port.dev, &ep->packey[dir].p); } static void musb_tx_packet_complete(USBPacket *packey, void *opaque)