[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 20/23] spapr: drop reference on child object during cor
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 20/23] spapr: drop reference on child object during core realization |
Date: |
Fri, 1 Jul 2016 16:41:56 +1000 |
From: Greg Kurz <address@hidden>
When a core is being realized, we create a child object for each thread
of the core.
The child is first initialized with object_initialize() which sets its ref
count to 1, and then added to the core with object_property_add_child()
which bumps the ref count to 2.
When the core gets released, object_unparent() decreases the ref count to 1,
and we g_free() the object: we hence loose the reference on an unfinalized
object. This is likely to cause random crashes.
Let's drop the extra reference as soon as we don't need it, after the
thread is added to the core.
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Bharata B Rao <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_cpu_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index e30b159..bba3612 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -300,6 +300,7 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error
**errp)
if (local_err) {
goto err;
}
+ object_unref(obj);
}
object_child_foreach(OBJECT(dev), spapr_cpu_core_realize_child,
&local_err);
if (local_err) {
--
2.7.4
- [Qemu-ppc] [PULL 19/23] spapr: Restore support for 970MP and POWER8NVL CPU cores, (continued)
- [Qemu-ppc] [PULL 19/23] spapr: Restore support for 970MP and POWER8NVL CPU cores, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 12/23] target-ppc: Eliminate redundant and incorrect function booke206_page_size_to_tlb, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 01/23] ppc: Add a bunch of hypervisor SPRs to Book3s, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 13/23] ppc: Fix 64K pages support in full emulation, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 08/23] ppc: Print HSRR0/HSRR1 in "info registers", David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 18/23] target-ppc: gen_pause for instructions: yield, mdoio, mdoom, miso, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 09/23] hw/ppc/spapr: Add some missing hcall function set strings, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 22/23] spapr: drop duplicate variable in spapr_core_release(), David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 23/23] qmp: fix spapr example of query-hotpluggable-cpus, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 07/23] ppc: LPCR is a HV resource, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 20/23] spapr: drop reference on child object during core realization,
David Gibson <=
- [Qemu-ppc] [PULL 04/23] ppc: Fix conditions for delivering external interrupts to a guest, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 11/23] spapr: Restore support for older PowerPC CPU cores, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 06/23] ppc: Initial HDEC support, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 16/23] ppc/xics: Implement H_IPOLL using an accessor, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 14/23] ppc/xics: Rename existing xics to xics_spapr, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 15/23] ppc/xics: Move SPAPR specific code to a separate file, David Gibson, 2016/07/01
- [Qemu-ppc] [PULL 17/23] ppc/xics: Replace "icp" with "xics" in most places, David Gibson, 2016/07/01
- Re: [Qemu-ppc] [PULL 00/23] ppc-for-2.7 queue 20160701, Peter Maydell, 2016/07/01