summaryrefslogtreecommitdiffstats
path: root/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz2017-07-14 09:50:40 +0200
committerDavid Gibson2017-07-17 07:07:05 +0200
commitdf8658de43db242ea82183d75cc957c2b0fa013a (patch)
tree4b9beb71756951d5aad7849a345ac0a8b9f5abc6 /hw/ppc
parentpseries: Allow HPT resizing with KVM (diff)
downloadqemu-df8658de43db242ea82183d75cc957c2b0fa013a.tar.gz
qemu-df8658de43db242ea82183d75cc957c2b0fa013a.tar.xz
qemu-df8658de43db242ea82183d75cc957c2b0fa013a.zip
spapr: fix memory leak in spapr_core_pre_plug()
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 <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr.c4
1 files 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);