69382d8b3e
If device doesn't have parent assined before its realize is called, device_set_realized() will implicitly set parent to '/machine/unattached'. However device_set_realized() may fail after that point at several other points leaving not realized object dangling in '/machine/unattached' and as result caller of obj = object_new() obj->ref == 1 object_property_set_bool(obj,..., true, "realized",...) obj->ref == 2 if (fail) object_unref(obj); obj->ref == 1 will get object leak instead of expected object destruction. Fix it by making device_set_realized() to cleanup after itself in case of failure. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> |
||
---|---|---|
.. | ||
bus.c | ||
empty_slot.c | ||
fw-path-provider.c | ||
hotplug.c | ||
irq.c | ||
loader.c | ||
machine.c | ||
Makefile.objs | ||
nmi.c | ||
null-machine.c | ||
platform-bus.c | ||
ptimer.c | ||
qdev-properties-system.c | ||
qdev-properties.c | ||
qdev.c | ||
register.c | ||
stream.c | ||
sysbus.c | ||
uboot_image.h |