]> Git Repo - qemu.git/commit
hw/pci-host: Use object_initialize_child for correct reference counting
authorThomas Huth <[email protected]>
Tue, 30 Apr 2019 19:15:52 +0000 (21:15 +0200)
committerThomas Huth <[email protected]>
Thu, 2 May 2019 14:56:33 +0000 (16:56 +0200)
commitaff39be0ed9753c9c323f64a14f5533dd5c43525
treecca49d78c7df6ac7ab137c7139f812b3ec6ef101
parent25ed0ecc0946a50b747fde6c8bce3d0ec99bdeac
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 <[email protected]>
Message-Id: <20190430191552[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
hw/pci-host/designware.c
hw/pci-host/gpex.c
hw/pci-host/q35.c
hw/pci-host/xilinx-pcie.c
This page took 0.024874 seconds and 4 git commands to generate.