Message ID | 1540794581-33578-3-git-send-email-liq3ea@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | nvme: fix two issues in nvme unhotplug | expand |
On 29/10/18 7:29, Li Qiang wrote: > 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> > --- > 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); > } > >
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); }
This avoid a memory leak in unhotplug nvme device. Signed-off-by: Li Qiang <liq3ea@gmail.com> --- hw/block/nvme.c | 3 +++ 1 file changed, 3 insertions(+)