On 29/10/18 7:29, Li Qiang wrote:
This avoid a memory leak in unhotplug nvme device.
Signed-off-by: Li Qiang <liq...@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com>
---
hw/block/nvme.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 359a06d0ad..09d7c90259 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -1332,6 +1332,9 @@ static void nvme_exit(PCIDevice *pci_dev)
g_free(n->cq);
g_free(n->sq);
+ if (n->cmb_size_mb) {
+ g_free(n->cmbuf);
+ }
msix_uninit_exclusive_bar(pci_dev);
}