@samitouri / QOSamiQemu / commits / 163f9a4e06

hw/usb/hcd-ohci: Clean up USBPacket before freeing ISO TD packet

ohci_service_iso_td() allocates a USBPacket and frees it after synchronous completion, but it does not call usb_packet_cleanup() first. Call usb_packet_cleanup() before g_free() so resources owned by USBPacket are released. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3463 Signed-off-by: Munkhbaatar Enkhbaatar <munkhuu0825@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Munkhbaatar Enkhbaatar committed May 6, 2026 at 23:22 UTC 163f9a4e0651b3b4a1438d919489a200d3646ba3
1 file changed +1
hw/usb/hcd-ohci.c
+1
@@ -755,6 +755,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed)
755 } else {
756 ret = pkt->status;
757 }
758 + usb_packet_cleanup(pkt);
759 g_free(pkt);
760
761 trace_usb_ohci_iso_td_so(start_offset, end_offset, start_addr, end_addr,