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 commit8149e2992f
. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> (cherry picked from commitdf8658de43
) Conflicts: hw/ppc/spapr.c * fix context dep on459264ef2
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
parent
2e40aad231
commit
2a7526b0ce
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue