qemu/hw/arm
Peter Maydell 5fdba4d41d hw/arm/stm32f205_soc: Don't leak TYPE_OR_IRQ objects
In stm32f250_soc_initfn() we mostly use the standard pattern
for child objects of calling object_initialize_child(). However
for s->adc_irqs we call object_new() and then later qdev_realize(),
and we never unref the object on deinit. This causes a leak,
detected by ASAN on the device-introspect-test:

Indirect leak of 10 byte(s) in 1 object(s) allocated from:
    #0 0x5b9fc4789de3 in malloc (/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/qemu-system-arm+0x21f1de3) (BuildId: 267a2619a026ed91c78a07b1eb2ef15381538efe)
    #1 0x740de3f28b09 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x62b09) (BuildId: 1eb6131419edb83b2178b682829a6913cf682d75)
    #2 0x740de3f3e4d8 in g_strdup (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x784d8) (BuildId: 1eb6131419edb83b2178b682829a6913cf682d75)
    #3 0x5b9fc70159e1 in g_strdup_inline /usr/include/glib-2.0/glib/gstrfuncs.h:321:10
    #4 0x5b9fc70159e1 in object_property_try_add /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:1276:18
    #5 0x5b9fc7015f94 in object_property_add /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:1294:12
    #6 0x5b9fc701b900 in object_add_link_prop /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:2021:10
    #7 0x5b9fc701b3fc in object_property_add_link /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:2037:12
    #8 0x5b9fc4c299fb in qdev_init_gpio_out_named /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/core/gpio.c:90:9
    #9 0x5b9fc4c29b26 in qdev_init_gpio_out /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/core/gpio.c:101:5
    #10 0x5b9fc4c0f77a in or_irq_init /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/core/or-irq.c:70:5
    #11 0x5b9fc70257e1 in object_init_with_type /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:428:9
    #12 0x5b9fc700cd4b in object_initialize_with_type /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:570:5
    #13 0x5b9fc700e66d in object_new_with_type /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:774:5
    #14 0x5b9fc700e750 in object_new /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../qom/object.c:789:12
    #15 0x5b9fc68b2162 in stm32f205_soc_initfn /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-asan/../../hw/arm/stm32f205_soc.c:69:26

Switch to using object_initialize_child() like all our
other child objects for this SoC object.

Cc: qemu-stable@nongnu.org
Fixes: b63041c8f6 ("STM32F205: Connect the ADC devices")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20250821154229.2417453-1-peter.maydell@linaro.org
(cherry picked from commit 2e27650bdd)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-08-31 08:08:30 +03:00
..
allwinner-a10.c hw/arm: Mark Allwinner Technology devices as little-endian 2025-02-16 14:41:46 +01:00
allwinner-h3.c hw/arm: Mark Allwinner Technology devices as little-endian 2025-02-16 14:41:46 +01:00
allwinner-r40.c hw/arm: Mark Allwinner Technology devices as little-endian 2025-02-16 14:41:46 +01:00
armsse.c hw/arm/armsse: Use device_class_set_props_n 2024-12-19 19:33:37 +01:00
armv7m.c hw/arm/armv7m: Expose and access System Control Space as little endian 2025-03-31 16:25:59 +02:00
aspeed_ast10x0.c aspeed: Remove duplicate typename in AspeedSoCClass 2025-03-09 14:36:52 +01:00
aspeed_ast27x0.c hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts 2025-05-29 10:31:23 +03:00
aspeed_ast2400.c aspeed: Remove duplicate typename in AspeedSoCClass 2025-03-09 14:36:52 +01:00
aspeed_ast2600.c aspeed: Remove duplicate typename in AspeedSoCClass 2025-03-09 14:36:52 +01:00
aspeed_eeprom.c
aspeed_eeprom.h
aspeed_soc_common.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
aspeed.c hw/arm/aspeed: Add Machine Support for AST2700 A1 2025-03-09 14:36:53 +01:00
b-l475e-iot01a.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
bananapi_m2u.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
bcm2835_peripherals.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
bcm2836.c hw/arm: Constify all Property 2024-12-15 12:54:27 -06:00
bcm2838_peripherals.c
bcm2838.c
boot.c hw: Centralize handling of -machine dumpdtb option 2025-02-24 15:03:42 +00:00
collie.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
cubieboard.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
digic_boards.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
digic.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
exynos4_boards.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
exynos4210.c hw/arm/exynos4210: Specify explicitly the GIC has 64 external IRQs 2025-02-20 14:20:29 +00:00
fby35.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
fsl-imx6.c hw/sd/sdhci: Remove need for SDHCI_VENDOR_IMX definition 2025-03-12 11:11:42 +01:00
fsl-imx6ul.c hw/sd/sdhci: Remove need for SDHCI_VENDOR_IMX definition 2025-03-12 11:11:42 +01:00
fsl-imx7.c hw/sd/sdhci: Remove need for SDHCI_VENDOR_IMX definition 2025-03-12 11:11:42 +01:00
fsl-imx8mp.c hw/arm/fsl-imx8mp: Wire VIRQ and VFIQ 2025-07-13 11:16:36 +03:00
fsl-imx25.c hw/sd/sdhci: Remove need for SDHCI_VENDOR_IMX definition 2025-03-12 11:11:42 +01:00
fsl-imx31.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
highbank.c hw/arm/highbank: Specify explicitly the GIC has 128 external IRQs 2025-02-20 14:20:29 +00:00
imx8mp-evk.c hw/arm/imx8mp-evk: Temporarily remove unimplemented imx8mp-fspi node from devicetree 2025-04-08 20:46:10 +02:00
imx25_pdk.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
integratorcp.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
Kconfig rust: Kconfig: Factor out whether PL011 is Rust or C 2025-03-20 09:23:18 +01:00
kzm.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
mcimx6ul-evk.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
mcimx7d-sabre.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
meson.build hw/arm: Add i.MX 8M Plus EVK board 2025-02-25 15:32:58 +00:00
microbit.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
mps2-tz.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
mps2.c hw/arm/mps2: Configure the AN500 CPU with 16 MPU regions 2025-06-17 23:31:32 +03:00
mps3r.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
msf2-soc.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
msf2-som.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
musca.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
musicpal.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
netduino2.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
netduinoplus2.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
npcm7xx_boards.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
npcm7xx.c hw/ssi: Make flash size a property in NPCM7XX FIU 2025-02-20 14:20:29 +00:00
npcm8xx_boards.c hw/arm/npcm8xx_boards: Correct valid_cpu_types setting of NPCM8XX SoC 2025-05-08 10:20:54 +03:00
npcm8xx.c hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info 2025-06-01 16:10:07 +03:00
nrf51_soc.c hw/arm/nrf51: Rename ARMv7MState 'cpu' -> 'armv7m' 2025-01-27 12:58:26 +00:00
olimex-stm32-h405.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
omap1.c hw/arm/omap1: Convert information printfs to tracepoints 2025-03-05 02:13:29 +01:00
omap_sx1.c hw/arm/omap_sx1: Remove ifdeffed out debug printf 2025-03-05 02:13:29 +01:00
orangepi.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
raspi4b.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
raspi.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
realview.c hw/arm/realview: Specify explicitly the GIC has 64 external IRQs 2025-02-20 14:20:29 +00:00
sabrelite.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
sbsa-ref.c hw/arm: enable secure EL2 timers for sbsa machine 2025-03-07 10:08:21 +00:00
smmu-common.c hw/arm/smmu: Introduce smmu_configs_inv_sid_range() helper 2025-03-07 10:59:25 +00:00
smmu-internal.h hw/arm/smmu: Introduce smmu_configs_inv_sid_range() helper 2025-03-07 10:59:25 +00:00
smmuv3-internal.h hw/arm/smmuv3: Assert input to oas2bits() is valid 2024-07-29 13:34:18 +01:00
smmuv3.c hw/arm/smmu: Introduce smmu_configs_inv_sid_range() helper 2025-03-07 10:59:25 +00:00
stellaris.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
stm32f100_soc.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
stm32f205_soc.c hw/arm/stm32f205_soc: Don't leak TYPE_OR_IRQ objects 2025-08-31 08:08:30 +03:00
stm32f405_soc.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
stm32l4x5_soc.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
stm32vldiscovery.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
strongarm.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
strongarm.h
trace-events hw/arm/smmu: Introduce smmu_configs_inv_sid_range() helper 2025-03-07 10:59:25 +00:00
trace.h
versatilepb.c hw/arm/versatilepb: Convert printfs to LOG_GUEST_ERROR 2025-03-05 02:13:29 +01:00
vexpress.c hw/arm/vexpress: Specify explicitly the GIC has 64 external IRQs 2025-02-20 14:20:29 +00:00
virt-acpi-build.c acpi/ghes: simplify the per-arch caller to build HEST table 2025-01-15 13:06:49 -05:00
virt.c hw/arm/virt: Check bypass iommu is not set for iommu-map DT property 2025-06-17 23:29:33 +03:00
xen-pvh.c hw/arm: Remove all invalid uses of auto_create_sdcard=true 2025-02-16 14:25:08 +01:00
xen-stubs.c hw/xen/xen-hvm: Reduce included headers 2025-03-04 14:45:34 +01:00
xilinx_zynq.c hw/arm/xilinx_zynq: Specify explicitly the GIC has 64 external IRQs 2025-02-20 14:20:29 +00:00
xlnx-versal-virt.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
xlnx-versal.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
xlnx-zcu102.c hw/boards: Rename no_sdcard -> auto_create_sdcard 2025-02-16 14:25:08 +01:00
xlnx-zynqmp.c hw/arm/xlnx-zynqmp: Use &error_abort for programming errors 2025-02-16 14:25:07 +01:00