]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
pci/shpc: Do not unparent in instance_finalize()
authorAkihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Mon, 27 Oct 2025 01:24:18 +0000 (10:24 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 5 Feb 2026 08:18:39 +0000 (03:18 -0500)
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: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20251027-shpc-v1-1-00e9b20a355d@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20251027-shpc-v1-1-00e9b20a355d@rsg.ci.i.u-tokyo.ac.jp>

hw/pci/shpc.c

index aac6f2d034592b8b809e96ec3b36781242fc43a1..938602866d7778bf234875a2004cf8e36d307b78 100644 (file)
@@ -735,7 +735,6 @@ void shpc_free(PCIDevice *d)
     if (!shpc) {
         return;
     }
-    object_unparent(OBJECT(&shpc->mmio));
     g_free(shpc->config);
     g_free(shpc->cmask);
     g_free(shpc->wmask);