aboutsummaryrefslogtreecommitdiff
path: root/tests/usb-hcd-ehci-test.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-02-07 15:47:39 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-03-01 11:51:29 +0400
commit62030ed135e4cfb960cb626510cbb3ea77bb9ef9 (patch)
treea64cf3de98fe919ccfc46d50c864ba2fd496905e /tests/usb-hcd-ehci-test.c
parentd3510ff9d7e78c89ee41175082ae5390e6e5b285 (diff)
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>
Diffstat (limited to 'tests/usb-hcd-ehci-test.c')
-rw-r--r--tests/usb-hcd-ehci-test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c
index fba84b4bee..944eb1c088 100644
--- a/tests/usb-hcd-ehci-test.c
+++ b/tests/usb-hcd-ehci-test.c
@@ -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();