diff options
author | Li Qiang | 2020-08-12 18:17:12 +0200 |
---|---|---|
committer | Gerd Hoffmann | 2020-08-31 08:10:47 +0200 |
commit | dd8525472a17bc7f21aa6024aaa19ad53d28750a (patch) | |
tree | 777c60aef1d57e9552b0ab30f6ac1032829f1092 /hw/usb | |
parent | hw: xhci: check return value of 'usb_packet_map' (diff) | |
download | qemu-dd8525472a17bc7f21aa6024aaa19ad53d28750a.tar.gz qemu-dd8525472a17bc7f21aa6024aaa19ad53d28750a.tar.xz qemu-dd8525472a17bc7f21aa6024aaa19ad53d28750a.zip |
hw: ehci: destroy sglist in error path
This may cause resource leak.
Signed-off-by: Li Qiang <liq3ea@163.com>
Message-Id: <20200812161712.29361-1-liq3ea@163.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r-- | hw/usb/hcd-ehci.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 1495e8f7fa..58cceacbf8 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1445,6 +1445,7 @@ static int ehci_process_itd(EHCIState *ehci, dev = ehci_find_device(ehci, devaddr); if (dev == NULL) { ehci_trace_guest_bug(ehci, "no device found"); + qemu_sglist_destroy(&ehci->isgl); return -1; } pid = dir ? USB_TOKEN_IN : USB_TOKEN_OUT; |