mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
usb: ehci: fix memory leak in ehci
In usb_ehci_init function, it initializes 's->ipacket', but there is no corresponding function to free this. As the ehci can be hotplug and unplug, this will leak host memory leak. In order to make the hierarchy clean, we should add a ehci pci finalize function, then call the clean function in ehci device. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Message-id: 589a85b8.3c2b9d0a.b8e6.1434@mx.google.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
56f9e46b84
commit
d710e1e7bd
3 changed files with 15 additions and 0 deletions
|
@ -2545,6 +2545,11 @@ void usb_ehci_init(EHCIState *s, DeviceState *dev)
|
|||
&s->mem_ports);
|
||||
}
|
||||
|
||||
void usb_ehci_finalize(EHCIState *s)
|
||||
{
|
||||
usb_packet_cleanup(&s->ipacket);
|
||||
}
|
||||
|
||||
/*
|
||||
* vim: expandtab ts=4
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue