From: Jiri Denemark Date: Thu, 16 Jun 2016 14:08:30 +0000 (+0200) Subject: cpu: Don't overwrite errors in cpuGetModels X-Git-Tag: v2.3.0-rc1~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edf51c136c3025e4253aeca121049a7a0ebe8aa8;p=thirdparty%2Flibvirt.git cpu: Don't overwrite errors in cpuGetModels cpuGetSubDriver already reports a useful error. Signed-off-by: Jiri Denemark --- diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index d2b7ce3da9..fae3885ef5 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -765,13 +765,8 @@ cpuGetModels(virArch arch, char ***models) VIR_DEBUG("arch=%s", virArchToString(arch)); - driver = cpuGetSubDriver(arch); - if (driver == NULL) { - virReportError(VIR_ERR_INVALID_ARG, - _("cannot find a driver for the architecture %s"), - virArchToString(arch)); + if (!(driver = cpuGetSubDriver(arch))) return -1; - } if (!driver->getModels) { if (models)