diff mbox

[21/28] tests: fix virtio-9p-test leaks

Message ID 20170207135211.15870-22-marcandre.lureau@redhat.com
State New
Headers show

Commit Message

Marc-André Lureau Feb. 7, 2017, 1:52 p.m. UTC
Spotted by ASAN.

Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Greg Kurz <groug@kaod.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/virtio-9p-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg Kurz Feb. 7, 2017, 4:43 p.m. UTC | #1
On Tue,  7 Feb 2017 17:52:04 +0400
Marc-André Lureau <marcandre.lureau@redhat.com> wrote:

> Spotted by ASAN.
> 
> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> Cc: Greg Kurz <groug@kaod.org>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---

I was a bit confused at first but hopefully I could find the definition of
qvirtio_pci_device_free() in patch 08/28 :)

Reviewed-by: Greg Kurz <groug@kaod.org>

>  tests/virtio-9p-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
> index 9556291567..43a1ad813f 100644
> --- a/tests/virtio-9p-test.c
> +++ b/tests/virtio-9p-test.c
> @@ -80,7 +80,7 @@ static void qvirtio_9p_pci_stop(QVirtIO9P *v9p)
>  {
>      qvirtqueue_cleanup(v9p->dev->bus, v9p->vq, v9p->qs->alloc);
>      qvirtio_pci_device_disable(container_of(v9p->dev, QVirtioPCIDevice, vdev));
> -    g_free(v9p->dev);
> +    qvirtio_pci_device_free((QVirtioPCIDevice *)v9p->dev);
>      qvirtio_9p_stop(v9p);
>  }
>
diff mbox

Patch

diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
index 9556291567..43a1ad813f 100644
--- a/tests/virtio-9p-test.c
+++ b/tests/virtio-9p-test.c
@@ -80,7 +80,7 @@  static void qvirtio_9p_pci_stop(QVirtIO9P *v9p)
 {
     qvirtqueue_cleanup(v9p->dev->bus, v9p->vq, v9p->qs->alloc);
     qvirtio_pci_device_disable(container_of(v9p->dev, QVirtioPCIDevice, vdev));
-    g_free(v9p->dev);
+    qvirtio_pci_device_free((QVirtioPCIDevice *)v9p->dev);
     qvirtio_9p_stop(v9p);
 }