diff options
author | Li Qiang <liq3ea@gmail.com> | 2018-10-28 23:29:41 -0700 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-11-12 17:46:57 +0100 |
commit | a883d6a0bcbff889c932015179a25a1b5ea8e096 (patch) | |
tree | dcb9db1677b8bb09d774869b791e50d1b903f99e /hw | |
parent | 20faf0f5f8aba33405a6206cd26f0d2b49ac174a (diff) |
nvme: free cmbuf in nvme_exit
This avoid a memory leak in unhotplug nvme device.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/nvme.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |