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
commit20610cb4e279ba4d3ebab5a9b92d282cc6a81c8b (patch)
tree987ec8d9437ef52758b375115226836fafb9f2ae
parente8bd35dc12f6f0287f3b958de0704b557c6b6103 (diff)
downloadqemu-20610cb4e279ba4d3ebab5a9b92d282cc6a81c8b.tar.gz
qemu-20610cb4e279ba4d3ebab5a9b92d282cc6a81c8b.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 15406c51f6..51b3adf52f 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,