提交 4d8debba 编写于 作者: G Gerd Hoffmann

usb: fix use after free

The ->complete() callback might have released the USBPacket (uhci
actually does), so we must not touch it after the callback returns.
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 0c402e5a
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册