[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.8 12/24] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.8 12/24] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array |
Date: |
Wed, 13 Dec 2023 16:00:21 +0300 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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 9e4aa1fafe added:
DEFINE_PROP_ARRAY("pg0-lock",
XlnxVersalEFuseCtrl, extra_pg0_lock_n16,
extra_pg0_lock_spec, qdev_prop_uint16, uint16_t),
but forgot to free the 'extra_pg0_lock_spec' array. Do it in the
instance_finalize() handler.
Cc: qemu-stable@nongnu.org
Fixes: 9e4aa1fafe ("hw/nvram: Xilinx Versal eFuse device") # v6.2.0+
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20231121174051.63038-6-philmd@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 4f10c66077e39969940d928077560665e155cac8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c
b/hw/nvram/xlnx-versal-efuse-ctrl.c
index b35ba65ab5..2d2dc09526 100644
--- a/hw/nvram/xlnx-versal-efuse-ctrl.c
+++ b/hw/nvram/xlnx-versal-efuse-ctrl.c
@@ -725,6 +725,13 @@ static void efuse_ctrl_init(Object *obj)
sysbus_init_irq(sbd, &s->irq_efuse_imr);
}
+static void efuse_ctrl_finalize(Object *obj)
+{
+ XlnxVersalEFuseCtrl *s = XLNX_VERSAL_EFUSE_CTRL(obj);
+
+ g_free(s->extra_pg0_lock_spec);
+}
+
static const VMStateDescription vmstate_efuse_ctrl = {
.name = TYPE_XLNX_VERSAL_EFUSE_CTRL,
.version_id = 1,
@@ -762,6 +769,7 @@ static const TypeInfo efuse_ctrl_info = {
.instance_size = sizeof(XlnxVersalEFuseCtrl),
.class_init = efuse_ctrl_class_init,
.instance_init = efuse_ctrl_init,
+ .instance_finalize = efuse_ctrl_finalize,
};
static void efuse_ctrl_register_types(void)
--
2.39.2
- [Stable-7.2.8 00/24] Patch Round-up for stable 7.2.8, freeze on 2023-12-23, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 01/24] target/arm: Fix SME FMOPA (16-bit), BFMOPA, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 06/24] tests/avocado: Replace assertEquals() for Python 3.12 compatibility, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 08/24] target/arm: Set IL bit for pauth, SVE access, BTI trap syndromes, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 02/24] hw/ide/ahci: fix legacy software reset, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 04/24] net: Update MemReentrancyGuard for NIC, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 05/24] linux-user: Fix loaddr computation for some elf files, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 03/24] net: Provide MemReentrancyGuard * to qemu_new_nic(), Michael Tokarev, 2023/12/13
- [Stable-7.2.8 07/24] tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 12/24] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array,
Michael Tokarev <=
- [Stable-7.2.8 09/24] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize(), Michael Tokarev, 2023/12/13
- [Stable-7.2.8 10/24] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize(), Michael Tokarev, 2023/12/13
- [Stable-7.2.8 11/24] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize(), Michael Tokarev, 2023/12/13
- [Stable-7.2.8 13/24] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 15/24] hw/mips/malta: Fix the malta machine on big endian hosts, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 14/24] vmdk: Don't corrupt desc file in vmdk_write_cid, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 18/24] hw/acpi/erst: Do not ignore Error* in realize handler, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 16/24] hw/audio/hda-codec: fix multiplication overflow, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 21/24] ui/gtk-egl: move function calls back to regular code path, Michael Tokarev, 2023/12/13
- [Stable-7.2.8 20/24] ui/gtk-egl: Check EGLSurface before doing scanout, Michael Tokarev, 2023/12/13