From: Akihiko Odaki Date: Mon, 27 Oct 2025 01:24:18 +0000 (+0900) Subject: pci/shpc: Do not unparent in instance_finalize() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d8dd5ec084732a9933925aa2c4fdff9a1aae7ef;p=thirdparty%2Fqemu.git pci/shpc: Do not unparent in instance_finalize() 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 Reviewed-by: Michael S. Tsirkin Message-ID: <20251027-shpc-v1-1-00e9b20a355d@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Michael S. Tsirkin Message-Id: <20251027-shpc-v1-1-00e9b20a355d@rsg.ci.i.u-tokyo.ac.jp> --- diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c index aac6f2d034..938602866d 100644 --- a/hw/pci/shpc.c +++ b/hw/pci/shpc.c @@ -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);