summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunkhbaatar Enkhbaatar <munkhuu0825@gmail.com>2026-05-06 23:22:47 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2026-06-11 22:27:44 +0300
commit3ab9adb3cb70108cb45c58da868e0f99776c0df1 (patch)
treeb1f5bf2b9c0acd1d43ba619406deea6c5452dfe3
parentb29be616b8002557f60ed313adca15497a980906 (diff)
downloadqemu-3ab9adb3cb70108cb45c58da868e0f99776c0df1.tar.gz
qemu-3ab9adb3cb70108cb45c58da868e0f99776c0df1.zip
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> (cherry picked from commit 163f9a4e0651b3b4a1438d919489a200d3646ba3) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--hw/usb/hcd-ohci.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 6ed8046fc2..37a11f0c94 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -756,6 +756,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed)
} else {
ret = pkt->status;
}
+ usb_packet_cleanup(pkt);
g_free(pkt);
trace_usb_ohci_iso_td_so(start_offset, end_offset, start_addr, end_addr,