]> 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)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 24 Jul 2024 13:14:36 +0000 (16:14 +0300)
commit9d0076b4a1a49a125ca9567cd4641d07b0447573
tree7f815f286a8caebc385a84cf09337728fcf0a38f
parent437c556037ac9101bfcb6fbbabddeca7e3a93bf1
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>
(cherry picked from commit 0c2086bc7360565dfb9933181dafaefe2c94cddf)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: rename loongson back to longarch for 9.0 due to lack of
 v9.0.0-582-gb4a12dfc2132 "hw/intc/loongarch_ipi: Rename as loongson_ipi")
hw/intc/loongarch_ipi.c