From: Greg Kurz Date: Fri, 14 Jul 2017 07:50:40 +0000 (+0200) Subject: spapr: fix memory leak in spapr_core_pre_plug() X-Git-Tag: v2.9.1~40 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=2a7526b0ce649b5c3b06790b9ea7a7b318d38ef4;hp=2e40aad231fbb8944bc2557fd9dce0d4e8d2523e;p=mirror_qemu.git 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 Signed-off-by: David Gibson (cherry picked from commit df8658de43db242ea82183d75cc957c2b0fa013a) Conflicts: hw/ppc/spapr.c * fix context dep on 459264ef2 Signed-off-by: Michael Roth --- diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 58c15efbab..bda3854e2b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2805,7 +2805,7 @@ static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev, if (cc->nr_threads != smp_threads) { error_setg(errp, "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);