Skip to content

Commit

Permalink
hw: ehci: destroy sglist in error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
terenceli authored and kraxel committed Aug 31, 2020
1 parent 21bc315 commit dd85254
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/usb/hcd-ehci.c
Expand Up @@ -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;
Expand Down

0 comments on commit dd85254

Please sign in to comment.