qemu-patch-raspberry4/hw/i386
Nikita Belov ac369a7796 hw/i386/acpi-build.c: Fix memory leak in acpi_build_tables_cleanup()
There are three ACPI tables: 'linker_data', 'rsdp' and 'table_data'. They are
used differently. Two of them are being copied before using and only the copy
is used later. But the third is used directly. Because of that we need to free
two tables completely and delete only wrapper for the third one.

Valgrind output:
==23931== 131,072 bytes in 1 blocks are definitely lost in loss record 7,729 of 7,734
==23931==    at 0x4C2CE8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23931==    by 0x2EA920: realloc_and_trace (vl.c:2811)
==23931==    by 0x509E6AE: g_realloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)
==23931==    by 0x506DB32: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)
==23931==    by 0x506E463: g_array_set_size (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)
==23931==    by 0x256A4F: acpi_align_size (acpi-build.c:487)
==23931==    by 0x259F92: acpi_build (acpi-build.c:1601)
==23931==    by 0x25A212: acpi_setup (acpi-build.c:1682)
==23931==    by 0x24F346: pc_guest_info_machine_done (pc.c:1110)
==23931==    by 0x55FAAB: notifier_list_notify (notify.c:39)
==23931==    by 0x2EA704: qemu_run_machine_init_done_notifiers (vl.c:2759)
==23931==    by 0x2EEC3C: main (vl.c:4504)

Signed-off-by: Nikita Belov <zodiac@ispras.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
2014-11-02 13:44:52 +02:00
..
kvm bootindex: move calling add_boot_device_patch to bootindex setter function 2014-10-15 10:46:01 +02:00
xen hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
acpi-build.c hw/i386/acpi-build.c: Fix memory leak in acpi_build_tables_cleanup() 2014-11-02 13:44:52 +02:00
acpi-build.h i386: ACPI table generation code from seabios 2013-10-14 17:48:57 +03:00
acpi-defs.h intel-iommu: add DMAR table to ACPI tables 2014-08-28 23:10:22 +02:00
acpi-dsdt-cpu-hotplug.dsl dsdt: tweak ACPI ID for hotplug resource device 2014-04-08 15:22:59 +03:00
acpi-dsdt-dbug.dsl i386: add ACPI table files from seabios 2013-10-14 17:48:51 +03:00
acpi-dsdt-hpet.dsl ACPI: Remove commented-out code from HPET._CRS 2014-02-10 11:09:33 +02:00
acpi-dsdt-isa.dsl ACPI: Fix AppleSMC _STA size 2014-01-26 13:06:48 +02:00
acpi-dsdt-pci-crs.dsl pc: Q35 DSDT: exclude CPU hotplug IO range from PCI bus resources 2014-01-26 13:11:44 +02:00
acpi-dsdt.dsl hw:i386: typo fix: MEMORY_HOPTLUG_DEVICE -> MEMORY_HOTPLUG_DEVICE 2014-08-14 13:20:49 +02:00
acpi-dsdt.hex.generated hw:i386: typo fix: MEMORY_HOPTLUG_DEVICE -> MEMORY_HOTPLUG_DEVICE 2014-08-14 13:20:49 +02:00
bios-linker-loader.c i386: Add missing include file for QEMU_PACKED 2014-02-01 13:43:52 +04:00
bios-linker-loader.h i386: add bios linker/loader 2013-10-14 17:48:52 +03:00
intel_iommu.c intel-iommu: add IOTLB using hash table 2014-08-28 23:10:22 +02:00
intel_iommu_internal.h intel-iommu: add IOTLB using hash table 2014-08-28 23:10:22 +02:00
kvmvapic.c kvmvapic: fix migration when VM paused and when not running Windows 2014-09-26 13:32:04 +02:00
Makefile.objs intel-iommu: introduce Intel IOMMU (VT-d) emulation 2014-08-28 23:10:22 +02:00
multiboot.c multiboot: Calculate upper_mem in the ROM 2013-06-28 14:01:52 -05:00
multiboot.h refer to FWCfgState explicitly 2013-06-02 18:14:02 +03:00
pc.c -machine vmport=off: Allow disabling of VMWare ioport emulation 2014-11-02 13:44:12 +02:00
pc_piix.c smbios: Encode UUID according to SMBIOS specification 2014-11-02 13:44:52 +02:00
pc_q35.c smbios: Encode UUID according to SMBIOS specification 2014-11-02 13:44:52 +02:00
pc_sysfw.c hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
q35-acpi-dsdt.dsl hw:i386: typo fix: MEMORY_HOPTLUG_DEVICE -> MEMORY_HOTPLUG_DEVICE 2014-08-14 13:20:49 +02:00
q35-acpi-dsdt.hex.generated acpi: update generated files 2014-06-19 16:41:52 +03:00
smbios.c smbios: Encode UUID according to SMBIOS specification 2014-11-02 13:44:52 +02:00
ssdt-mem.dsl hw:i386: typo fix: MEMORY_HOPTLUG_DEVICE -> MEMORY_HOTPLUG_DEVICE 2014-08-14 13:20:49 +02:00
ssdt-mem.hex.generated acpi: update generated files 2014-06-19 16:41:52 +03:00
ssdt-misc.dsl hw:i386: typo fix: MEMORY_HOPTLUG_DEVICE -> MEMORY_HOTPLUG_DEVICE 2014-08-14 13:20:49 +02:00
ssdt-misc.hex.generated acpi: update generated files 2014-06-19 16:41:52 +03:00
ssdt-pcihp.dsl acpi-build: append description for non-hotplug 2014-03-09 21:09:30 +02:00
ssdt-pcihp.hex.generated acpi: update generated files 2014-06-19 16:41:52 +03:00
ssdt-proc.dsl ssdt: fix PBLK length 2013-10-14 17:48:57 +03:00
ssdt-proc.hex.generated acpi: update generated files 2014-06-19 16:41:52 +03:00
ssdt-tpm.dsl Add ACPI tables for TPM 2014-08-25 00:16:06 +02:00
ssdt-tpm.hex.generated ssdt-tpm: add generated hex file to git 2014-08-25 00:16:06 +02:00