Skip to content

Commit

Permalink
nvme: free cmbuf in nvme_exit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Qiang authored and kevmw committed Nov 12, 2018
1 parent 20faf0f commit a883d6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hw/block/nvme.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit a883d6a

Please sign in to comment.