diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 0019a49503217bf078c0d8cbfb2cb8009fe164f5..418cdac86332d8c992b9c25a47255bccae96d318 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -1069,6 +1069,7 @@ static void device_finalize(Object *obj) NamedGPIOList *ngl, *next; DeviceState *dev = DEVICE(obj); + qemu_opts_del(dev->opts); QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) { QLIST_REMOVE(ngl, node); @@ -1118,9 +1119,6 @@ static void device_unparent(Object *obj) g_free(dev->canonical_path); dev->canonical_path = NULL; } - - qemu_opts_del(dev->opts); - dev->opts = NULL; } static void device_class_init(ObjectClass *class, void *data)