misc: edu: free dma timer in device unit
PATCH 1/1 misc: edu: free dma timer in device unit
From: Li Qiang <[email protected]>
This can avoid a memory leak when hotplug and unplug.
Signed-off-by Li Qiang <[email protected]>
--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)
hw/misc/edu.c +1 -0
@@ -375,6 +375,7 @@ static void pci_edu_uninit(PCIDevice *pdev)qemu_mutex_destroy (&edu->thr_mutex);timer_del (&edu->dma_timer); +timer_free (&edu->dma_timer); } static void edu_obj_uint64(Object *obj, Visitor *v, const char *name,
Signature · 1 line
1.8.3.1
Quoted 14 lines · Li Qiang
From: Li Qiang <[email protected]>
This can avoid a memory leak when hotplug and unplug.
Signed-off-by Li Qiang <[email protected]>--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)hw/misc/edu.c +0
-0
hw/misc/edu.c static void pci_edu_uninit(PCIDevice *pdev) · line 378
Quoted 4 lines
hw/misc/edu.c +1
-0@@ -375,6 +375,7 @@ static void pci_edu_uninit(PCIDevice *pdev)qemu_mutex_destroy (&edu->thr_mutex);timer_del (&edu->dma_timer); +timer_free (&edu->dma_timer);
Freeing a static timer does not sound correct to me?
thanks,
Signature · 2 lines
js suse labs
2017-02-08 14:53 GMT+08:00 Jiri Slaby <[email protected]>:
Quoted 17 lines · Li Qiang
Quoted 16 lines
From: Li Qiang <[email protected]>
This can avoid a memory leak when hotplug and unplug.
Signed-off-by Li Qiang <[email protected]>--- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+)hw/misc/edu.c +0
-0@@ -375,6 +375,7 @@ static void pci_edu_uninit(PCIDevice *pdev)qemu_mutex_destroy (&edu->thr_mutex);
Quoted 6 lines
hw/misc/edu.c static void pci_edu_uninit(PCIDevice *pdev) · line 378
Quoted 2 lines
hw/misc/edu.c +1
-0timer_del (&edu->dma_timer); +timer_free (&edu->dma_timer);Freeing a static timer does not sound correct to me?
Sorry, as there is a few example that doesn't free timer, I don't notice this is a static timer.
Quoted 5 lines
thanks,
--
js
suse labs