diff mbox series

block/nvme: Remove memory leak

Message ID 20200414151727.17012-1-philmd@redhat.com
State New
Headers show
Series block/nvme: Remove memory leak | expand

Commit Message

Philippe Mathieu-Daudé April 14, 2020, 3:17 p.m. UTC
Fixes: bdd6a90a9 ("Add VFIO based NVMe driver")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 block/nvme.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/block/nvme.c b/block/nvme.c
index 7b7c0cc5d6..9f3c7ab819 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -163,6 +163,7 @@  static void nvme_init_queue(BlockDriverState *bs, NVMeQueue *q,
     }
     r = qemu_vfio_dma_map(s->vfio, q->queue, bytes, false, &q->iova);
     if (r) {
+        qemu_vfree(q->queue);
         error_setg(errp, "Cannot map queue");
     }
 }