All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/6] delay timer_new from init to realize to fix memleaks.
@ 2020-02-27  2:50 Pan Nengyuan
  2020-02-27  2:50 ` [PATCH v3 1/6] s390x: fix memleaks in cpu_finalize Pan Nengyuan
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Pan Nengyuan @ 2020-02-27  2:50 UTC (permalink / raw)
  To: peter.maydell
  Cc: euler.robot, qemu-arm, Pan Nengyuan, qemu-devel, zhang.zhanghailiang

This series delay timer_new from init into realize to avoid memleaks when we call 'device_list_properties'.
And do timer_free only in s390x_cpu_finalize because it's hotplugable. However, It's not valid in mos6522
if we move timer_new from init to realize, because it's never called at all. So we also add calls to mos6522_realize()
in mac_via_realize to make this move to be valid.

v1:
   - Delay timer_new() from init() to realize() to fix memleaks.
v2:
   - Similarly to other cleanups, move timer_new into realize in target/s390x/cpu.c (Suggested by Philippe Mathieu-Daudé).
   - Send these two patches as a series instead of send each as a single patch but with wrong subject in v1.
v3:
   - It's not valid in mos6522 if we move timer_new from init to realize, because it's never called at all.
     Thus, we remove null check in reset, and add calls to mos6522_realize() in mac_via_realize to make this move to be valid.
   - split patch by device to make it more clear.

Pan Nengyuan (6):
  s390x: fix memleaks in cpu_finalize
  hw/arm/pxa2xx: move timer_new from init() into realize() to avoid
    memleaks
  hw/arm/spitz: move timer_new from init() into realize() to avoid
    memleaks
  hw/arm/strongarm: move timer_new from init() into realize() to avoid
    memleaks
  hw/misc/mos6522: move timer_new from init() into realize() to avoid
    memleaks
  hw/timer/cadence_ttc: move timer_new from init() into realize() to
    avoid memleaks

 hw/arm/pxa2xx.c        | 17 +++++++++++------
 hw/arm/spitz.c         |  8 +++++++-
 hw/arm/strongarm.c     | 18 ++++++++++++------
 hw/misc/mac_via.c      |  5 +++++
 hw/misc/mos6522.c      |  6 ++++++
 hw/timer/cadence_ttc.c | 16 +++++++++++-----
 target/s390x/cpu.c     | 22 ++++++++++++++++++----
 7 files changed, 70 insertions(+), 22 deletions(-)

-- 
2.18.2



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-03-04 20:42 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27  2:50 [PATCH v3 0/6] delay timer_new from init to realize to fix memleaks Pan Nengyuan
2020-02-27  2:50 ` [PATCH v3 1/6] s390x: fix memleaks in cpu_finalize Pan Nengyuan
2020-02-27  8:41   ` David Hildenbrand
2020-02-27  8:55     ` Philippe Mathieu-Daudé
2020-02-27  9:06       ` David Hildenbrand
2020-02-27  8:58     ` Pan Nengyuan
2020-02-27  9:04       ` David Hildenbrand
2020-02-27  9:15         ` Pan Nengyuan
2020-02-27 11:06   ` Cornelia Huck
2020-02-27 11:25     ` Pan Nengyuan
2020-03-02 14:34   ` Stefan Hajnoczi
2020-03-03  1:39     ` Pan Nengyuan
2020-02-27  2:50 ` [PATCH v3 2/6] hw/arm/pxa2xx: move timer_new from init() into realize() to avoid memleaks Pan Nengyuan
2020-02-27  2:50 ` [PATCH v3 3/6] hw/arm/spitz: " Pan Nengyuan
2020-02-27  2:50 ` [PATCH v3 4/6] hw/arm/strongarm: " Pan Nengyuan
2020-02-27  2:50 ` [PATCH v3 5/6] hw/misc/mos6522: " Pan Nengyuan
2020-03-02 13:21   ` Peter Maydell
2020-03-02 19:17     ` Mark Cave-Ayland
2020-03-03  1:36       ` Pan Nengyuan
2020-03-04 20:40         ` Mark Cave-Ayland
2020-02-27  2:50 ` [PATCH v3 6/6] hw/timer/cadence_ttc: " Pan Nengyuan
2020-02-27  6:33   ` Alistair Francis
2020-03-02 13:21 ` [PATCH v3 0/6] delay timer_new from init to realize to fix memleaks Peter Maydell
2020-03-03  1:26   ` Pan Nengyuan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.