mbox series

[0/3] delay timer_new to avoid memleaks

Message ID 20200205070659.22488-1-pannengyuan@huawei.com (mailing list archive)
Headers show
Series delay timer_new to avoid memleaks | expand

Message

Pan Nengyuan Feb. 5, 2020, 7:06 a.m. UTC
From: Pan Nengyuan <pannengyuan@huawei.com>

This series delay timer_new into realize() to fix some memleaks when we call 'device-list-properties'.

Pan Nengyuan (3):
  armv7m_systick: delay timer_new to avoid memleaks
  stm32f2xx_timer: delay timer_new to avoid memleaks
  stellaris: delay timer_new to avoid memleaks

 hw/arm/stellaris.c         | 7 ++++++-
 hw/timer/armv7m_systick.c  | 6 ++++++
 hw/timer/stm32f2xx_timer.c | 5 +++++
 3 files changed, 17 insertions(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Feb. 5, 2020, 1:16 p.m. UTC | #1
On 2/5/20 8:06 AM, pannengyuan@huawei.com wrote:
> From: Pan Nengyuan <pannengyuan@huawei.com>
> 
> This series delay timer_new into realize() to fix some memleaks when we call 'device-list-properties'.
> 
> Pan Nengyuan (3):
>    armv7m_systick: delay timer_new to avoid memleaks
>    stm32f2xx_timer: delay timer_new to avoid memleaks
>    stellaris: delay timer_new to avoid memleaks
> 
>   hw/arm/stellaris.c         | 7 ++++++-
>   hw/timer/armv7m_systick.c  | 6 ++++++
>   hw/timer/stm32f2xx_timer.c | 5 +++++
>   3 files changed, 17 insertions(+), 1 deletion(-)

You might want to look at Coccinelle [*] and write a spatch script to 
check/fix all the codebase at once. You can find some examples in 
scripts/coccinelle/.

[*] http://coccinelle.lip6.fr/
Pan Nengyuan Feb. 6, 2020, 1:14 a.m. UTC | #2
On 2/5/2020 9:16 PM, Philippe Mathieu-Daudé wrote:
> On 2/5/20 8:06 AM, pannengyuan@huawei.com wrote:
>> From: Pan Nengyuan <pannengyuan@huawei.com>
>>
>> This series delay timer_new into realize() to fix some memleaks when we call 'device-list-properties'.
>>
>> Pan Nengyuan (3):
>>    armv7m_systick: delay timer_new to avoid memleaks
>>    stm32f2xx_timer: delay timer_new to avoid memleaks
>>    stellaris: delay timer_new to avoid memleaks
>>
>>   hw/arm/stellaris.c         | 7 ++++++-
>>   hw/timer/armv7m_systick.c  | 6 ++++++
>>   hw/timer/stm32f2xx_timer.c | 5 +++++
>>   3 files changed, 17 insertions(+), 1 deletion(-)
> 
> You might want to look at Coccinelle [*] and write a spatch script to check/fix all the codebase at once. You can find some examples in scripts/coccinelle/.

Thanks for these tips. I will pay attention.

> 
> [*] http://coccinelle.lip6.fr/
>
Peter Maydell Feb. 7, 2020, 1:42 p.m. UTC | #3
On Wed, 5 Feb 2020 at 07:07, <pannengyuan@huawei.com> wrote:
>
> From: Pan Nengyuan <pannengyuan@huawei.com>
>
> This series delay timer_new into realize() to fix some memleaks when we call 'device-list-properties'.
>
> Pan Nengyuan (3):
>   armv7m_systick: delay timer_new to avoid memleaks
>   stm32f2xx_timer: delay timer_new to avoid memleaks
>   stellaris: delay timer_new to avoid memleaks
>
>  hw/arm/stellaris.c         | 7 ++++++-
>  hw/timer/armv7m_systick.c  | 6 ++++++
>  hw/timer/stm32f2xx_timer.c | 5 +++++
>  3 files changed, 17 insertions(+), 1 deletion(-)



Applied to target-arm.next, thanks.

-- PMM