[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [BUG] USB assertion triggers in usb_packet_complete()
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [BUG] USB assertion triggers in usb_packet_complete() |
Date: |
Tue, 11 Oct 2011 09:35:11 +0200 |
Am Mon, 10 Oct 2011 15:03:41 +0200
schrieb Thomas Huth <address@hidden>:
>
> I am currently facing a problem when running QEMU (up-to-date git
> version) with OHCI and a lot of virtual USB devices.
> The emulator dies with the following assertion:
>
> qemu-system-arm: hw/usb.c:337: usb_packet_complete:
> Assertion `p->owner != ((void *)0)' failed.
Not sure whether this is the right solution, but this patch fixes the
problem for me:
diff --git a/hw/usb.c b/hw/usb.c
index fa90204..7cef9e2 100644
--- a/hw/usb.c
+++ b/hw/usb.c
@@ -25,6 +25,7 @@
*/
#include "qemu-common.h"
#include "usb.h"
+#include "usb-desc.h"
#include "iov.h"
void usb_attach(USBPort *port)
@@ -334,7 +335,9 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p)
void usb_packet_complete(USBDevice *dev, USBPacket *p)
{
/* Note: p->owner != dev is possible in case dev is a hub */
- assert(p->owner != NULL);
+ if (dev->device->bDeviceClass != USB_CLASS_HUB) {
+ assert(p->owner != NULL);
+ }
p->owner = NULL;
dev->port->ops->complete(dev->port, p);
}
Thomas