qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

armv7m_systick: delay timer_new to avoid memleaks

There is a memory leak when we call 'device_list_properties' with typename = armv7m_systick. It's easy to reproduce as follow:

virsh qemu-monitor-command vm1 --pretty '{"execute": "device-list-properties", "arguments": {"typename": "armv7m_systick"}}'

This patch delay timer_new to fix this memleaks.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Message-id: 20200205070659.22488-2-pannengyuan@huawei.com
Cc: qemu-arm@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Pan Nengyuan and committed by
Peter Maydell
f3a508eb fa3236a9

+6
+6
hw/timer/armv7m_systick.c
··· 216 216 memory_region_init_io(&s->iomem, obj, &systick_ops, s, "systick", 0xe0); 217 217 sysbus_init_mmio(sbd, &s->iomem); 218 218 sysbus_init_irq(sbd, &s->irq); 219 + } 220 + 221 + static void systick_realize(DeviceState *dev, Error **errp) 222 + { 223 + SysTickState *s = SYSTICK(dev); 219 224 s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, systick_timer_tick, s); 220 225 } 221 226 ··· 238 243 239 244 dc->vmsd = &vmstate_systick; 240 245 dc->reset = systick_reset; 246 + dc->realize = systick_realize; 241 247 } 242 248 243 249 static const TypeInfo armv7m_systick_info = {