Re: [PATCH 2/2] hw/sd/sd: Delay timer_new_ns() from init to realize to avoid memleaks

2020-06-04 Thread Philippe Mathieu-Daudé
On 2/17/20 2:26 PM, Peter Maydell wrote: > On Sat, 15 Feb 2020 at 15:48, Philippe Mathieu-Daudé > wrote: >> >> In commit f3a508eb4e the Euler Robot reported calling timer_new() >> in instance_init() can leak heap memory. The easier fix is to >> delay the timer creation at instance realize(). Simi

Re: [PATCH 2/2] hw/sd/sd: Delay timer_new_ns() from init to realize to avoid memleaks

2020-02-17 Thread Peter Maydell
On Sat, 15 Feb 2020 at 15:48, Philippe Mathieu-Daudé wrote: > > In commit f3a508eb4e the Euler Robot reported calling timer_new() > in instance_init() can leak heap memory. The easier fix is to > delay the timer creation at instance realize(). Similarly move > timer_del() into a new instance unrea

[PATCH 2/2] hw/sd/sd: Delay timer_new_ns() from init to realize to avoid memleaks

2020-02-15 Thread Philippe Mathieu-Daudé
In commit f3a508eb4e the Euler Robot reported calling timer_new() in instance_init() can leak heap memory. The easier fix is to delay the timer creation at instance realize(). Similarly move timer_del() into a new instance unrealize() method. This case was found with the following coccinelle scrip