cpu: Simplify ppc64ModelFromCPU()

This commit is contained in:
Andrea Bolognani 2015-08-07 17:39:04 +02:00
parent 4590f0678f
commit c238d16af4

View File

@ -163,17 +163,10 @@ ppc64ModelFromCPU(const virCPUDef *cpu,
if (!(model = ppc64ModelFind(map, cpu->model))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown CPU model %s"), cpu->model);
goto error;
return NULL;
}
if (!(model = ppc64ModelCopy(model)))
goto error;
return model;
error:
ppc64ModelFree(model);
return NULL;
return ppc64ModelCopy(model);
}