aboutsummaryrefslogtreecommitdiff
path: root/hw/core/machine.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-10-01 19:04:03 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-01 19:04:03 +0200
commite7f944bb94a375e8ee7469ffa535ea6e11ce59e1 (patch)
treefbcc74c7bff80fc5255705a54d8d04d9d320dbd1 /hw/core/machine.c
parent2b52619994ab48504c5fc0d32a1af24159405ce0 (diff)
downloadqemu-e7f944bb94a375e8ee7469ffa535ea6e11ce59e1.zip
qemu-e7f944bb94a375e8ee7469ffa535ea6e11ce59e1.tar.gz
qemu-e7f944bb94a375e8ee7469ffa535ea6e11ce59e1.tar.bz2
machine: Use g_autoptr in machine_set_smp
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/core/machine.c')
-rw-r--r--hw/core/machine.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 54f04a5..d49ebc2 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -897,7 +897,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name,
{
MachineClass *mc = MACHINE_GET_CLASS(obj);
MachineState *ms = MACHINE(obj);
- SMPConfiguration *config;
+ g_autoptr(SMPConfiguration) config = NULL;
ERRP_GUARD();
if (!visit_type_SMPConfiguration(v, name, &config, errp)) {
@@ -920,7 +920,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name,
smp_parse(ms, config, errp);
if (*errp) {
- goto out_free;
+ return;
}
/* sanity-check smp_cpus and max_cpus against mc */
@@ -935,9 +935,6 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name,
ms->smp.max_cpus,
mc->name, mc->max_cpus);
}
-
-out_free:
- qapi_free_SMPConfiguration(config);
}
static void machine_class_init(ObjectClass *oc, void *data)