[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the objec
Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized
Fri, 18 Feb 2022 17:46:49 +0000
On Fri, 18 Feb 2022 at 17:39, Damien Hedde <email@example.com> 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 during realize" is one of those cases I don't think we
handle very well. I'd like to see a view by one of our QOM experts
on what the best way to handle this is -- should one do the
cleanup in realize itself, or in instance_finalize? Do the
sub-objects that are being initialized and realized need to
be manually cleaned up in the realize-is-failing case, or is
that part automatic?
Which is to say that maybe this patch is the best way to do this,
but it would be nice to be sure about that...
[PATCH 2/5] target/riscv: add riscv_cpu_release_claimed_interrupts function, Damien Hedde, 2022/02/18
[PATCH 3/5] hw/intc/sifive_plic: report errors and free allocated memory, Damien Hedde, 2022/02/18
[PATCH 4/5] hw/intc/riscv_aclint: swi: report errors and free allocated memory, Damien Hedde, 2022/02/18
[PATCH 5/5] hw/intc/riscv_aclint: mtimer: report errors and free allocated memory, Damien Hedde, 2022/02/18