aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2020-09-14 14:34:51 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2020-10-09 10:15:06 +1100
commit9c4d1497e8d44a0045d04533bb822d453639c944 (patch)
tree1acd184860755efa312dcf0b613c7df7c92314a6 /hw/ppc
parentf0638a0b6bba455e8eaf518f23487d6ff1f59b5a (diff)
downloadqemu-9c4d1497e8d44a0045d04533bb822d453639c944.zip
qemu-9c4d1497e8d44a0045d04533bb822d453639c944.tar.gz
qemu-9c4d1497e8d44a0045d04533bb822d453639c944.tar.bz2
spapr: Fix error leak in spapr_realize_vcpu()
If spapr_irq_cpu_intc_create() fails, local_err isn't propagated and thus leaked. Fixes: 992861fb1e4c ("error: Eliminate error_propagate() manually") Cc: armbru@redhat.com Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <20200914123505.612812-2-groug@kaod.org> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr_cpu_core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 2125fda..3e4f402 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -232,7 +232,6 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
{
CPUPPCState *env = &cpu->env;
CPUState *cs = CPU(cpu);
- Error *local_err = NULL;
if (!qdev_realize(DEVICE(cpu), NULL, errp)) {
return;
@@ -244,7 +243,7 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
cpu_ppc_set_vhyp(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
kvmppc_set_papr(cpu);
- if (spapr_irq_cpu_intc_create(spapr, cpu, &local_err) < 0) {
+ if (spapr_irq_cpu_intc_create(spapr, cpu, errp) < 0) {
cpu_remove_sync(CPU(cpu));
return;
}