[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 20/21] spapr: fix memory leak in spapr_core_pre_plug()
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 20/21] spapr: fix memory leak in spapr_core_pre_plug() |
Date: |
Mon, 17 Jul 2017 16:56:20 +1000 |
From: Greg Kurz <address@hidden>
In case of error, we must ensure the dynamically allocated base_core_type
is freed, like it is done everywhere else in this function.
This is a regression introduced in QEMU 2.9 by commit 8149e2992f78.
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 68f936c4f8..970093e6b5 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3150,9 +3150,9 @@ static void spapr_core_pre_plug(HotplugHandler
*hotplug_dev, DeviceState *dev,
* total vcpus not a multiple of threads-per-core.
*/
if (mc->has_hotpluggable_cpus && (cc->nr_threads != smp_threads)) {
- error_setg(errp, "invalid nr-threads %d, must be %d",
+ error_setg(&local_err, "invalid nr-threads %d, must be %d",
cc->nr_threads, smp_threads);
- return;
+ goto out;
}
core_slot = spapr_find_cpu_slot(MACHINE(hotplug_dev), cc->core_id, &index);
--
2.13.3
- [Qemu-ppc] [PULL 00/21] ppc-for-2.10 queue 20170717, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 04/21] spapr: Treat devices added before inbound migration as coldplugged, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 20/21] spapr: fix memory leak in spapr_core_pre_plug(),
David Gibson <=
- [Qemu-ppc] [PULL 07/21] spapr: Abort on delete failure in spapr_drc_release(), David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 05/21] spapr: Remove 'awaiting_allocation' DRC flag, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 01/21] spapr: Remove unnecessary instance_size specifications from DRC subtypes, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 09/21] spapr: Cleanups relating to DRC awaiting_release field, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 12/21] spapr: Implement DR-indicator for physical DRCs only, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 19/21] pseries: Allow HPT resizing with KVM, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 06/21] spapr: Simplify unplug path, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 02/21] spapr: migrate pending_events of spapr state, David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 08/21] spapr: Refactor spapr_drc_detach(), David Gibson, 2017/07/17
- [Qemu-ppc] [PULL 03/21] spapr: Minor cleanups to events handling, David Gibson, 2017/07/17