]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/intc/loongson_ipi: Fix resource leak
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 23 Jul 2024 11:08:33 +0000 (13:08 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 23 Jul 2024 18:30:36 +0000 (20:30 +0200)
commit0c2086bc7360565dfb9933181dafaefe2c94cddf
treeee16980fd2147c028da52f998503f6e33d5d3a49
parent2465c89fb983eed670007742bd68c7d91b6d6f85
hw/intc/loongson_ipi: Fix resource leak

Once initialised, QOM objects can be realized and
unrealized multiple times before being finalized.
Resources allocated in REALIZE must be deallocated
in an equivalent UNREALIZE handler.

Free the CPU array in loongson_ipi_unrealize()
instead of loongson_ipi_finalize().

Cc: qemu-stable@nongnu.org
Fixes: 5e90b8db382 ("hw/loongarch: Set iocsr address space per-board rather than percpu")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20240723111405.14208-3-philmd@linaro.org>
hw/intc/loongson_ipi.c