]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 21 Nov 2023 17:40:48 +0000 (18:40 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 5 Dec 2023 09:32:36 +0000 (12:32 +0300)
commit48e0dfb837d8d4525a15d3faee6dd5b693efbaf0
treee2026051943bc14aa09d839a6830dab8e3496def
parent502f15db559c35ab38803c6071977e739a79c0b4
hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize()

Commit 0be6bfac62 ("qdev: Implement variable length array properties")
added the DEFINE_PROP_ARRAY() macro with the following comment:

  * It is the responsibility of the device deinit code to free the
  * @_arrayfield memory.

Commit 4fb013afcc added:

  DEFINE_PROP_ARRAY("oscclk", MPS2SCC, num_oscclk, oscclk_reset,
                    qdev_prop_uint32, uint32_t),

but forgot to free the 'oscclk_reset' array. Do it in the
instance_finalize() handler.

Cc: qemu-stable@nongnu.org
Fixes: 4fb013afcc ("hw/misc/mps2-scc: Support configurable number of OSCCLK values") # v6.0.0+
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20231121174051.63038-4-philmd@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 896dd6ff7b9f2575f1a908a07f26a70b58d8b675)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/misc/mps2-scc.c