[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH] xhci: Fix memory leak in xhci_kick_epctx when poweroff Guest
From: |
Chenqun (kuhn) |
Subject: |
RE: [PATCH] xhci: Fix memory leak in xhci_kick_epctx when poweroff GuestOS |
Date: |
Mon, 13 Jan 2020 09:39:14 +0000 |
>-----Original Message-----
>From: Gerd Hoffmann [mailto:address@hidden]
>Sent: Monday, January 13, 2020 3:48 PM
>To: Philippe Mathieu-Daudé <address@hidden>
>Cc: Chenqun (kuhn) <address@hidden>; qemu-
>address@hidden; address@hidden; Pannengyuan
><address@hidden>; Zhanghailiang
><address@hidden>
>Subject: Re: [PATCH] xhci: Fix memory leak in xhci_kick_epctx when poweroff
>GuestOS
>
>> > diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index
>> > 80988bb305..0d3d96d05a 100644
>> > --- a/hw/usb/hcd-xhci.c
>> > +++ b/hw/usb/hcd-xhci.c
>> > @@ -2000,6 +2000,7 @@ static void xhci_kick_epctx(XHCIEPContext
>*epctx, unsigned int streamid)
>> > if (xfer != NULL && xfer->running_retry) {
>> > DPRINTF("xhci: xfer nacked, stopping schedule\n");
>> > epctx->retry = xfer;
>> > + xhci_xfer_unmap(xfer);
>>
>> Shouldn't we use xhci_ep_free_xfer() instead?
>
>No, xhci will try to run the transfer again later.
>
>xhci will re-create the sgl then, so freeing the sgl here is correct. Patch
>added
>to usb queue.
Hi Gerd,
I test every keyboard input, it will leak once.
I tested qemu-4.0.0 also had this leak .
Maybe we should cc to qemu-stable ?
Thanks.
>
>thanks,
> Gerd