]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/sd/sdhci: Do not unparent in instance_finalize()
authorAkihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Wed, 24 Sep 2025 04:37:24 +0000 (13:37 +0900)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 24 Sep 2025 07:23:20 +0000 (09:23 +0200)
Children are automatically unparented so manually unparenting is
unnecessary.

Worse, automatic unparenting happens before the instance_finalize()
callback of the parent gets called, so object_unparent() calls in
the callback will refer to objects that are already unparented, which
is semantically incorrect.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Link: https://lore.kernel.org/r/20250924-use-v4-5-07c6c598f53d@rsg.ci.i.u-tokyo.ac.jp
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/sd/sdhci.c

index 3c897e54b721075a3ebd215e027fb73a65ff39b2..89b595ce4a5a7a34e15d3c1d1ac8b9d58534b166 100644 (file)
@@ -1578,10 +1578,6 @@ static void sdhci_sysbus_finalize(Object *obj)
 {
     SDHCIState *s = SYSBUS_SDHCI(obj);
 
-    if (s->dma_mr) {
-        object_unparent(OBJECT(s->dma_mr));
-    }
-
     sdhci_uninitfn(s);
 }