mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
tests: fix usb-test leaks
Fix the usb tests leaks. Spotted by ASAN. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
d3510ff9d7
commit
62030ed135
4 changed files with 17 additions and 0 deletions
|
@ -61,6 +61,15 @@ static void test_init(void)
|
|||
qusb_pci_init_one(pcibus, &ehci1, QPCI_DEVFN(0x1d, 7), 0);
|
||||
}
|
||||
|
||||
static void test_deinit(void)
|
||||
{
|
||||
uhci_deinit(&uhci1);
|
||||
uhci_deinit(&uhci2);
|
||||
uhci_deinit(&uhci3);
|
||||
uhci_deinit(&ehci1);
|
||||
qpci_free_pc(pcibus);
|
||||
}
|
||||
|
||||
static void pci_uhci_port_1(void)
|
||||
{
|
||||
g_assert(pcibus != NULL);
|
||||
|
@ -161,6 +170,7 @@ int main(int argc, char **argv)
|
|||
|
||||
test_init();
|
||||
ret = g_test_run();
|
||||
test_deinit();
|
||||
|
||||
qtest_end();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue