]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 21 Nov 2023 17:40:49 +0000 (18:40 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 5 Dec 2023 09:32:36 +0000 (12:32 +0300)
commita3e46300c59d423483a278772f41dc66dd3dc9f0
tree1f262cad68a5b0092cb8ca82df0f400f52075756
parent48e0dfb837d8d4525a15d3faee6dd5b693efbaf0
hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] 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 68fbcc344e added:

  DEFINE_PROP_ARRAY("read-only", XlnxEFuse, ro_bits_cnt, ro_bits,
                    qdev_prop_uint32, uint32_t),

but forgot to free the 'ro_bits' array. Do it in the instance_finalize
handler.

Cc: qemu-stable@nongnu.org
Fixes: 68fbcc344e ("hw/nvram: Introduce Xilinx eFuse QOM") # v6.2.0+
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20231121174051.63038-5-philmd@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 49b3e28b7bdfe771150d05c4b5860aa7854a4232)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/nvram/xlnx-efuse.c