Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized

2022-02-21 Thread Damien Hedde
On 2/18/22 18:46, Peter Maydell wrote: On Fri, 18 Feb 2022 at 17:39, Damien Hedde wrote: You're right. I was confused when re-writing the message. This leaks happen on init -> realize-failure -> finalize Because the array is allocated, then every cpu is initialized (and an error failure may h

Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized

2022-02-18 Thread Peter Maydell
On Fri, 18 Feb 2022 at 17:39, Damien Hedde wrote: > You're right. I was confused when re-writing the message. > This leaks happen on > init -> realize-failure -> finalize > Because the array is allocated, then every cpu is initialized (and an > error failure may happen for any of them). "Failure

Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized

2022-02-18 Thread Damien Hedde
On 2/18/22 18:23, Peter Maydell wrote: On Fri, 18 Feb 2022 at 16:53, Damien Hedde wrote: The array is dynamically allocated by realize() depending on the number of harts. This clean-up removes memory leaks which would happen in the 'init->finalize' life-cycle use-case (happening when user

Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized

2022-02-18 Thread Peter Maydell
On Fri, 18 Feb 2022 at 16:53, Damien Hedde wrote: > > The array is dynamically allocated by realize() depending on the > number of harts. > > This clean-up removes memory leaks which would happen in the > 'init->finalize' life-cycle use-case (happening when user creation > is allowed). If the all

[PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized

2022-02-18 Thread Damien Hedde
The array is dynamically allocated by realize() depending on the number of harts. This clean-up removes memory leaks which would happen in the 'init->finalize' life-cycle use-case (happening when user creation is allowed). Signed-off-by: Damien Hedde --- hw/riscv/riscv_hart.c | 8 1 fi