Skip to contentSkip to conversation

hw: ehci: destroy sglist in error path

PATCH In review Li Qiang 1 participant 1 message Aug 12, 2020

lore
Share & tools
lore

Li Qiang

author
#0 lore raw

PATCH 1/2 hw: ehci: destroy sglist in error path

This may cause resource leak.

---
 hw/usb/hcd-ehci.c | 1 +
 1 file changed, 1 insertion(+)
hw/usb/hcd-ehci.c +1 -0
index 1495e8f7fa..58cceacbf8 100644
@@ -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;
Signature · 1 line
2.17.1