qemu-usb: reset completion pointer

Reset the completion pointer to prevent a double free in case the
packet is processed during ISOC IN request handling.

Fixes #4041.
This commit is contained in:
Josef Söntgen 2021-02-25 18:31:16 +01:00 committed by Norman Feske
parent c03534e355
commit 42f3d2eccd

View File

@ -579,6 +579,8 @@ struct Usb_host_device : List<Usb_host_device>::Element
if (packet.completion) {
dynamic_cast<Completion *>(packet.completion)->free();
}
/* make sure we free the completion only once! */
packet.completion = nullptr;
}
Completion *find_valid_completion(USBPacket *p)