qemu-e2k/hw/pci-host
Thomas Huth aff39be0ed hw/pci-host: Use object_initialize_child for correct reference counting
Both functions, object_initialize() and object_property_add_child() increase
the reference counter of the new object, so one of the references has to be
dropped afterwards to get the reference counting right. Otherwise the child
object might not be properly cleaned up when the parent gets destroyed.
Some functions of the pci-host devices miss to drop one of the references.
Fix it by using object_initialize_child() instead, which takes care of
calling object_initialize(), object_property_add_child() and object_unref()
in the right order.

Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190430191552.4027-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2019-05-02 16:56:33 +02:00
..
Kconfig kconfig: add CONFIG_MSI_NONBROKEN 2019-03-18 09:39:57 +01:00
Makefile.objs build: actually use CONFIG_PAM 2019-02-05 16:50:19 +01:00
bonito.c hw/pci-host/bonito.c: Add PCI mem region mapped at the correct address 2019-02-21 19:36:47 +01:00
designware.c hw/pci-host: Use object_initialize_child for correct reference counting 2019-05-02 16:56:33 +02:00
gpex.c hw/pci-host: Use object_initialize_child for correct reference counting 2019-05-02 16:56:33 +02:00
grackle.c grackle: set device fw_name and address for correct fw path generation 2018-08-30 10:42:18 +10:00
pam.c pam: wrap MemoryRegion initialization in a transaction 2019-01-11 13:57:23 +01:00
piix.c piix_pci: fix i440fx data sheet link 2018-11-05 13:24:02 -05:00
ppce500.c PPC: e500: convert SysBus init method to a realize method 2018-11-08 12:04:40 +11:00
prep.c elf: Add optional function ptr to load_elf() to parse ELF notes 2019-02-05 16:50:16 +01:00
q35.c hw/pci-host: Use object_initialize_child for correct reference counting 2019-05-02 16:56:33 +02:00
sabre.c sabre: generate correct fw path for sabre PCI host bridge 2018-09-14 09:18:05 +01:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
uninorth.c uninorth: add ofw-addr property to allow correct fw path generation 2018-08-30 10:42:18 +10:00
versatile.c hw: Do not include "exec/address-spaces.h" if it is not necessary 2018-06-01 14:15:10 +02:00
xilinx-pcie.c hw/pci-host: Use object_initialize_child for correct reference counting 2019-05-02 16:56:33 +02:00