aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index b20b34d11f..a6c4c02947 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -159,6 +159,7 @@ int qdev_init(DeviceState *dev)
rc = dc->init(dev);
if (rc < 0) {
+ object_unparent(OBJECT(dev));
qdev_free(dev);
return rc;
}