From 62030ed135e4cfb960cb626510cbb3ea77bb9ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 7 Feb 2017 15:47:39 +0400 Subject: tests: fix usb-test leaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the usb tests leaks. Spotted by ASAN. Signed-off-by: Marc-André Lureau Reviewed-by: Gerd Hoffmann --- tests/libqos/usb.c | 5 +++++ tests/libqos/usb.h | 1 + 2 files changed, 6 insertions(+) (limited to 'tests/libqos') diff --git a/tests/libqos/usb.c b/tests/libqos/usb.c index 98408d93f3..0cdfaecda7 100644 --- a/tests/libqos/usb.c +++ b/tests/libqos/usb.c @@ -24,6 +24,11 @@ void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar) hc->bar = qpci_iomap(hc->dev, bar, NULL); } +void uhci_deinit(struct qhc *hc) +{ + g_free(hc->dev); +} + void uhci_port_test(struct qhc *hc, int port, uint16_t expect) { uint16_t value = qpci_io_readw(hc->dev, hc->bar, 0x10 + 2 * port); diff --git a/tests/libqos/usb.h b/tests/libqos/usb.h index 423dcfd82f..297cfc564d 100644 --- a/tests/libqos/usb.h +++ b/tests/libqos/usb.h @@ -11,6 +11,7 @@ struct qhc { void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar); void uhci_port_test(struct qhc *hc, int port, uint16_t expect); +void uhci_deinit(struct qhc *hc); void usb_test_hotplug(const char *bus_name, const int port, void (*port_check)(void)); -- cgit v1.2.3