aboutsummaryrefslogtreecommitdiff
path: root/hw/core/bus.c
diff options
context:
space:
mode:
authorLuc Michel <luc@lmichel.fr>2020-10-20 11:10:24 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-10-22 11:53:53 -0400
commita6e9b9123e7e24085b16a001a04f9059269c57c5 (patch)
tree59578ea84a8b110c97b530b8566feb0956a5edf2 /hw/core/bus.c
parent34f02e9f334956cef4e3af4433aaebe7e5ecf71f (diff)
downloadqemu-a6e9b9123e7e24085b16a001a04f9059269c57c5.zip
qemu-a6e9b9123e7e24085b16a001a04f9059269c57c5.tar.gz
qemu-a6e9b9123e7e24085b16a001a04f9059269c57c5.tar.bz2
hw/core/qdev-clock: add a reference on aliased clocks
When aliasing a clock with the qdev_alias_clock() function, a new link property is created on the device aliasing the clock. The link points to the aliased clock and use the OBJ_PROP_LINK_STRONG flag. This property is read only since it does not provide a check callback for modifications. The object_property_add_link() documentation stats that with OBJ_PROP_LINK_STRONG properties, the linked object reference count get decremented when the property is deleted. But it is _not_ incremented on creation (object_property_add_link() does not actually know the link). This commit increments the reference count on the aliased clock to ensure the aliased clock stays alive during the property lifetime, and to avoid a double-free memory error when the property gets deleted. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Luc Michel <luc@lmichel.fr> Message-Id: <20201020091024.320381-1-luc@lmichel.fr> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/core/bus.c')
0 files changed, 0 insertions, 0 deletions