The ->complete() callback might have released the USBPacket (uhci actually does), so we must not touch it after the callback returns.
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- hw/usb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/usb.c b/hw/usb.c index 685e775..a091e4e 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -338,8 +338,8 @@ void usb_packet_complete(USBDevice *dev, USBPacket *p) { /* Note: p->owner != dev is possible in case dev is a hub */ assert(p->owner != NULL); - dev->port->ops->complete(dev->port, p); p->owner = NULL; + dev->port->ops->complete(dev->port, p); } /* Cancel an active packet. The packed must have been deferred by -- 1.7.1