From nobody Thu Dec 26 12:29:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1732786243711418.90835190480493; Thu, 28 Nov 2024 01:30:43 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 07A761C54; Thu, 28 Nov 2024 04:30:42 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 0A5E718AE; Thu, 28 Nov 2024 04:29:55 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id E2C0A18C1; Wed, 27 Nov 2024 10:45:21 -0500 (EST) Received: from air.basealt.ru (air.basealt.ru [193.43.8.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 226D01757 for ; Wed, 27 Nov 2024 10:45:20 -0500 (EST) Received: from kuznetsovam-nb.office.basealt.ru (unknown [193.43.10.250]) by air.basealt.ru (Postfix) with ESMTPSA id E20E7233DB; Wed, 27 Nov 2024 18:45:18 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 165 seconds by postgrey-1.37 at lists.libvirt.org; Wed, 27 Nov 2024 10:45:20 EST From: Alexander Kuznetsov To: devel@lists.libvirt.org Subject: [PATCH] Change return type of functions that use VIR_EXPAND_N and never fail to void Date: Wed, 27 Nov 2024 18:45:09 +0300 Message-ID: <20241127154509.84193-1-kuznetsovam@altlinux.org> X-Mailer: git-send-email 2.42.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: kuznetsovam@altlinux.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: XHERYEHJP7GJ4WJN6WYMSIYTGTS34LDV X-Message-ID-Hash: XHERYEHJP7GJ4WJN6WYMSIYTGTS34LDV X-Mailman-Approved-At: Thu, 28 Nov 2024 09:29:53 -0500 CC: nickel@altlinux.org, egori@altlinux.org X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZM-MESSAGEID: 1732786245767019100 Content-Type: text/plain; charset="utf-8" These functions return value is invariant since VIR_EXPAND_N check removal in 7d2fd6e, so change its type and remove all dependent checks. Found by Linux Verification Center (linuxtesting.org) with Svace. Reported-by: Pavel Nekrasov Signed-off-by: Alexander Kuznetsov --- src/access/viraccessdriverstack.c | 4 +--- src/access/viraccessdriverstack.h | 2 +- src/access/viraccessmanager.c | 5 +---- src/admin/admin_remote.c | 3 +-- src/hyperv/hyperv_wmi.c | 13 ++++------- src/locking/lock_daemon.c | 10 ++------- src/locking/lock_driver_lockd.c | 3 +-- src/logging/log_daemon.c | 10 ++------- src/logging/log_manager.c | 3 +-- src/lxc/lxc_monitor.c | 4 +--- src/remote/remote_daemon.c | 20 ++++------------- src/remote/remote_driver.c | 17 +++++--------- src/rpc/gendispatch.pl | 5 +---- src/rpc/virnetclient.c | 6 ++--- src/rpc/virnetclient.h | 4 ++-- src/rpc/virnetserver.c | 3 +-- src/rpc/virnetserver.h | 2 +- src/util/virsysinfo.c | 37 ++++++++++--------------------- 18 files changed, 43 insertions(+), 108 deletions(-) diff --git a/src/access/viraccessdriverstack.c b/src/access/viraccessdriver= stack.c index fb9ea71665..9d6a0d4d1b 100644 --- a/src/access/viraccessdriverstack.c +++ b/src/access/viraccessdriverstack.c @@ -32,7 +32,7 @@ struct _virAccessDriverStackPrivate { }; =20 =20 -int virAccessDriverStackAppend(virAccessManager *manager, +void virAccessDriverStackAppend(virAccessManager *manager, virAccessManager *child) { virAccessDriverStackPrivate *priv =3D virAccessManagerGetPrivateData(m= anager); @@ -40,8 +40,6 @@ int virAccessDriverStackAppend(virAccessManager *manager, VIR_EXPAND_N(priv->managers, priv->managersLen, 1); =20 priv->managers[priv->managersLen-1] =3D child; - - return 0; } =20 =20 diff --git a/src/access/viraccessdriverstack.h b/src/access/viraccessdriver= stack.h index abcfc30ec3..f878ef1989 100644 --- a/src/access/viraccessdriverstack.h +++ b/src/access/viraccessdriverstack.h @@ -23,7 +23,7 @@ #include "access/viraccessdriver.h" =20 =20 -int virAccessDriverStackAppend(virAccessManager *manager, +void virAccessDriverStackAppend(virAccessManager *manager, virAccessManager *child); =20 extern virAccessDriver accessDriverStack; diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c index 481528c3b9..6d9fdee5f1 100644 --- a/src/access/viraccessmanager.c +++ b/src/access/viraccessmanager.c @@ -164,10 +164,7 @@ virAccessManager *virAccessManagerNewStack(const char = **names) if (!child) goto error; =20 - if (virAccessDriverStackAppend(manager, child) < 0) { - virObjectUnref(child); - goto error; - } + virAccessDriverStackAppend(manager, child); } =20 return manager; diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c index 3291a1e965..5c4913a76e 100644 --- a/src/admin/admin_remote.c +++ b/src/admin/admin_remote.c @@ -214,8 +214,7 @@ remoteAdminPrivNew(const char *sock_path) NULL, 0, NULL))) goto error; =20 - if (virNetClientAddProgram(priv->client, priv->program) < 0) - goto error; + virNetClientAddProgram(priv->client, priv->program); =20 return priv; error: diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 8bc376e22f..0b82f1f131 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -184,14 +184,12 @@ hypervFreeInvokeParams(hypervInvokeParamsList *params) } =20 =20 -static inline int +static inline void hypervCheckParams(hypervInvokeParamsList *params) { if (params->nbParams + 1 > params->nbAvailParams) { VIR_EXPAND_N(params->params, params->nbAvailParams, 5); } - - return 0; } =20 =20 @@ -212,8 +210,7 @@ hypervAddSimpleParam(hypervInvokeParamsList *params, co= nst char *name, { hypervParam *p =3D NULL; =20 - if (hypervCheckParams(params) < 0) - return -1; + hypervCheckParams(params); =20 p =3D ¶ms->params[params->nbParams]; p->type =3D HYPERV_SIMPLE_PARAM; @@ -245,8 +242,7 @@ hypervAddEprParam(hypervInvokeParamsList *params, { hypervParam *p =3D NULL; =20 - if (hypervCheckParams(params) < 0) - return -1; + hypervCheckParams(params); =20 p =3D ¶ms->params[params->nbParams]; p->type =3D HYPERV_EPR_PARAM; @@ -333,8 +329,7 @@ hypervAddEmbeddedParam(hypervInvokeParamsList *params, { hypervParam *p =3D NULL; =20 - if (hypervCheckParams(params) < 0) - return -1; + hypervCheckParams(params); =20 p =3D ¶ms->params[params->nbParams]; p->type =3D HYPERV_EMBEDDED_PARAM; diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index ba52ce7d77..0b86300b43 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -1066,10 +1066,7 @@ int main(int argc, char **argv) { goto cleanup; } =20 - if (virNetServerAddProgram(lockSrv, lockProgram) < 0) { - ret =3D VIR_DAEMON_ERR_INIT; - goto cleanup; - } + virNetServerAddProgram(lockSrv, lockProgram); =20 if (adminSrv !=3D NULL) { if (!(adminProgram =3D virNetServerProgramNew(ADMIN_PROGRAM, @@ -1079,10 +1076,7 @@ int main(int argc, char **argv) { ret =3D VIR_DAEMON_ERR_INIT; goto cleanup; } - if (virNetServerAddProgram(adminSrv, adminProgram) < 0) { - ret =3D VIR_DAEMON_ERR_INIT; - goto cleanup; - } + virNetServerAddProgram(adminSrv, adminProgram); } =20 /* Disable error func, now logging is setup */ diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index d75302dd0a..0b6c720477 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -213,8 +213,7 @@ static virNetClient *virLockManagerLockDaemonConnection= New(bool privileged, NULL))) goto error; =20 - if (virNetClientAddProgram(client, *prog) < 0) - goto error; + virNetClientAddProgram(client, *prog); =20 return client; =20 diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 5a9be4a44e..16a5dcea9a 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -864,10 +864,7 @@ int main(int argc, char **argv) { ret =3D VIR_DAEMON_ERR_INIT; goto cleanup; } - if (virNetServerAddProgram(logSrv, logProgram) < 0) { - ret =3D VIR_DAEMON_ERR_INIT; - goto cleanup; - } + virNetServerAddProgram(logSrv, logProgram); =20 if (adminSrv !=3D NULL) { if (!(adminProgram =3D virNetServerProgramNew(ADMIN_PROGRAM, @@ -877,10 +874,7 @@ int main(int argc, char **argv) { ret =3D VIR_DAEMON_ERR_INIT; goto cleanup; } - if (virNetServerAddProgram(adminSrv, adminProgram) < 0) { - ret =3D VIR_DAEMON_ERR_INIT; - goto cleanup; - } + virNetServerAddProgram(adminSrv, adminProgram); } =20 /* Disable error func, now logging is setup */ diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c index d8490f4e5a..19e23d65c5 100644 --- a/src/logging/log_manager.c +++ b/src/logging/log_manager.c @@ -88,8 +88,7 @@ virLogManagerConnect(bool privileged, NULL))) goto error; =20 - if (virNetClientAddProgram(client, *prog) < 0) - goto error; + virNetClientAddProgram(client, *prog); =20 VIR_FREE(daemonPath); VIR_FREE(logdpath); diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c index 811d6685e5..cf2fd1897f 100644 --- a/src/lxc/lxc_monitor.c +++ b/src/lxc/lxc_monitor.c @@ -169,9 +169,7 @@ virLXCMonitor *virLXCMonitorNew(virDomainObj *vm, mon))) goto error; =20 - if (virNetClientAddProgram(mon->client, - mon->program) < 0) - goto error; + virNetClientAddProgram(mon->client, mon->program); =20 mon->vm =3D virObjectRef(vm); memcpy(&mon->cb, cb, sizeof(mon->cb)); diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index 9e82132654..1d079c7e4b 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -1063,10 +1063,7 @@ int main(int argc, char **argv) { ret =3D VIR_DAEMON_ERR_INIT; goto cleanup; } - if (virNetServerAddProgram(srv, remoteProgram) < 0) { - ret =3D VIR_DAEMON_ERR_INIT; - goto cleanup; - } + virNetServerAddProgram(srv, remoteProgram); =20 if (!(lxcProgram =3D virNetServerProgramNew(LXC_PROGRAM, LXC_PROTOCOL_VERSION, @@ -1075,10 +1072,7 @@ int main(int argc, char **argv) { ret =3D VIR_DAEMON_ERR_INIT; goto cleanup; } - if (virNetServerAddProgram(srv, lxcProgram) < 0) { - ret =3D VIR_DAEMON_ERR_INIT; - goto cleanup; - } + virNetServerAddProgram(srv, lxcProgram); =20 if (!(qemuProgram =3D virNetServerProgramNew(QEMU_PROGRAM, QEMU_PROTOCOL_VERSION, @@ -1087,10 +1081,7 @@ int main(int argc, char **argv) { ret =3D VIR_DAEMON_ERR_INIT; goto cleanup; } - if (virNetServerAddProgram(srv, qemuProgram) < 0) { - ret =3D VIR_DAEMON_ERR_INIT; - goto cleanup; - } + virNetServerAddProgram(srv, qemuProgram); =20 if (!(srvAdm =3D virNetServerNew("admin", 1, config->admin_min_workers, @@ -1120,10 +1111,7 @@ int main(int argc, char **argv) { ret =3D VIR_DAEMON_ERR_INIT; goto cleanup; } - if (virNetServerAddProgram(srvAdm, adminProgram) < 0) { - ret =3D VIR_DAEMON_ERR_INIT; - goto cleanup; - } + virNetServerAddProgram(srvAdm, adminProgram); =20 if (timeout > 0) { if (virNetDaemonAutoShutdown(dmn, timeout) < 0) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index e76d9e9ba4..307f9ca945 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -1160,10 +1160,9 @@ doRemoteOpen(virConnectPtr conn, conn))) goto error; =20 - if (virNetClientAddProgram(priv->client, priv->remoteProgram) < 0 || - virNetClientAddProgram(priv->client, priv->lxcProgram) < 0 || - virNetClientAddProgram(priv->client, priv->qemuProgram) < 0) - goto error; + virNetClientAddProgram(priv->client, priv->remoteProgram); + virNetClientAddProgram(priv->client, priv->lxcProgram); + virNetClientAddProgram(priv->client, priv->qemuProgram); =20 /* Try and authenticate with server */ VIR_DEBUG("Trying authentication"); @@ -5664,10 +5663,7 @@ remoteDomainMigratePrepareTunnel3(virConnectPtr dcon= n, false))) return -1; =20 - if (virNetClientAddStream(priv->client, netst) < 0) { - virObjectUnref(netst); - return -1; - } + virNetClientAddStream(priv->client, netst); =20 st->driver =3D &remoteStreamDrv; st->privateData =3D netst; @@ -6433,10 +6429,7 @@ remoteDomainMigratePrepareTunnel3Params(virConnectPt= r dconn, false))) goto cleanup; =20 - if (virNetClientAddStream(priv->client, netst) < 0) { - virObjectUnref(netst); - goto cleanup; - } + virNetClientAddStream(priv->client, netst); =20 st->driver =3D &remoteStreamDrv; st->privateData =3D netst; diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index c5842dc796..724a6aed6e 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -1822,10 +1822,7 @@ elsif ($mode eq "client") { print " if (!(netst =3D virNetClientStreamNew(priv->remoteP= rogram, $call->{constname}, priv->counter, sparse)))\n"; print " goto cleanup;\n"; print "\n"; - print " if (virNetClientAddStream(priv->client, netst) < 0)= {\n"; - print " virObjectUnref(netst);\n"; - print " goto cleanup;\n"; - print " }"; + print " virNetClientAddStream(priv->client, netst);\n"; print "\n"; print " st->driver =3D &remoteStreamDrv;\n"; print " st->privateData =3D netst;\n"; diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 6d424eb599..39ccbd739c 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -1053,7 +1053,7 @@ bool virNetClientIsOpen(virNetClient *client) } =20 =20 -int virNetClientAddProgram(virNetClient *client, +void virNetClientAddProgram(virNetClient *client, virNetClientProgram *prog) { virObjectLock(client); @@ -1062,11 +1062,10 @@ int virNetClientAddProgram(virNetClient *client, client->programs[client->nprograms-1] =3D virObjectRef(prog); =20 virObjectUnlock(client); - return 0; } =20 =20 -int virNetClientAddStream(virNetClient *client, +void virNetClientAddStream(virNetClient *client, virNetClientStream *st) { virObjectLock(client); @@ -1075,7 +1074,6 @@ int virNetClientAddStream(virNetClient *client, client->streams[client->nstreams-1] =3D virObjectRef(st); =20 virObjectUnlock(client); - return 0; } =20 =20 diff --git a/src/rpc/virnetclient.h b/src/rpc/virnetclient.h index 1647a6cc71..29099791a0 100644 --- a/src/rpc/virnetclient.h +++ b/src/rpc/virnetclient.h @@ -117,10 +117,10 @@ int virNetClientDupFD(virNetClient *client, bool cloe= xec); =20 bool virNetClientHasPassFD(virNetClient *client); =20 -int virNetClientAddProgram(virNetClient *client, +void virNetClientAddProgram(virNetClient *client, virNetClientProgram *prog); =20 -int virNetClientAddStream(virNetClient *client, +void virNetClientAddStream(virNetClient *client, virNetClientStream *st); =20 void virNetClientRemoveStream(virNetClient *client, diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index a6c6443c55..91219c3eed 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -768,7 +768,7 @@ virNetServerAddServiceUNIX(virNetServer *srv, } =20 =20 -int +void virNetServerAddProgram(virNetServer *srv, virNetServerProgram *prog) { @@ -776,7 +776,6 @@ virNetServerAddProgram(virNetServer *srv, =20 VIR_EXPAND_N(srv->programs, srv->nprograms, 1); srv->programs[srv->nprograms-1] =3D virObjectRef(prog); - return 0; } =20 =20 diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h index 7756a1dd6c..c14d8bd10f 100644 --- a/src/rpc/virnetserver.h +++ b/src/rpc/virnetserver.h @@ -84,7 +84,7 @@ int virNetServerAddServiceUNIX(virNetServer *srv, size_t max_queued_clients, size_t nrequests_client_max); =20 -int virNetServerAddProgram(virNetServer *srv, +void virNetServerAddProgram(virNetServer *srv, virNetServerProgram *prog); =20 int virNetServerSetTLSContext(virNetServer *srv, diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index dbcbca62ed..3575669ac3 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -263,7 +263,7 @@ virSysinfoParsePPCSystem(const char *base, virSysinfoSy= stemDef **sysdef) return ret; } =20 -static int +static void virSysinfoParsePPCProcessor(const char *base, virSysinfoDef *ret) { const char *cur; @@ -303,8 +303,6 @@ virSysinfoParsePPCProcessor(const char *base, virSysinf= oDef *ret) } =20 } - - return 0; } =20 /* virSysinfoRead for PowerPC @@ -325,8 +323,7 @@ virSysinfoReadPPC(void) =20 ret->nprocessor =3D 0; ret->processor =3D NULL; - if (virSysinfoParsePPCProcessor(outbuf, ret) < 0) - return NULL; + virSysinfoParsePPCProcessor(outbuf, ret); =20 if (virSysinfoParsePPCSystem(outbuf, &ret->system) < 0) return NULL; @@ -383,7 +380,7 @@ virSysinfoParseARMSystem(const char *base, virSysinfoSy= stemDef **sysdef) return ret; } =20 -static int +static void virSysinfoParseARMProcessor(const char *base, virSysinfoDef *ret) { const char *cur; @@ -393,7 +390,7 @@ virSysinfoParseARMProcessor(const char *base, virSysinf= oDef *ret) =20 if (!(tmp_base =3D strstr(base, "model name")) && !(tmp_base =3D strstr(base, "Processor"))) - return 0; + return; =20 eol =3D strchr(tmp_base, '\n'); cur =3D strchr(tmp_base, ':') + 1; @@ -420,7 +417,7 @@ virSysinfoParseARMProcessor(const char *base, virSysinf= oDef *ret) } =20 VIR_FREE(processor_type); - return 0; + return; } =20 /* virSysinfoRead for ARMv7 @@ -451,8 +448,7 @@ virSysinfoReadARM(void) =20 ret->nprocessor =3D 0; ret->processor =3D NULL; - if (virSysinfoParseARMProcessor(outbuf, ret) < 0) - return NULL; + virSysinfoParseARMProcessor(outbuf, ret); =20 if (virSysinfoParseARMSystem(outbuf, &ret->system) < 0) return NULL; @@ -753,7 +749,7 @@ virSysinfoParseX86System(const char *base, virSysinfoSy= stemDef **sysdef) return ret; } =20 -static int +static void virSysinfoParseX86BaseBoard(const char *base, virSysinfoBaseBoardDef **baseBoard, size_t *nbaseBoard) @@ -827,7 +823,6 @@ virSysinfoParseX86BaseBoard(const char *base, =20 *nbaseBoard =3D nboards; *baseBoard =3D g_steal_pointer(&boards); - return 0; } =20 =20 @@ -1006,7 +1001,7 @@ virSysinfoParseOEMStrings(const char *base, } =20 =20 -static int +static void virSysinfoParseX86Processor(const char *base, virSysinfoDef *ret) { const char *cur, *tmp_base; @@ -1102,11 +1097,9 @@ virSysinfoParseX86Processor(const char *base, virSys= infoDef *ret) =20 base +=3D strlen("Processor Information"); } - - return 0; } =20 -static int +static void virSysinfoParseX86Memory(const char *base, virSysinfoDef *ret) { const char *cur, *tmp_base; @@ -1197,8 +1190,6 @@ virSysinfoParseX86Memory(const char *base, virSysinfo= Def *ret) next: base +=3D strlen("Memory Device"); } - - return 0; } =20 virSysinfoDef * @@ -1223,8 +1214,7 @@ virSysinfoReadDMI(void) if (virSysinfoParseX86System(outbuf, &ret->system) < 0) return NULL; =20 - if (virSysinfoParseX86BaseBoard(outbuf, &ret->baseBoard, &ret->nbaseBo= ard) < 0) - return NULL; + virSysinfoParseX86BaseBoard(outbuf, &ret->baseBoard, &ret->nbaseBoard); =20 if (virSysinfoParseX86Chassis(outbuf, &ret->chassis) < 0) return NULL; @@ -1234,13 +1224,10 @@ virSysinfoReadDMI(void) =20 ret->nprocessor =3D 0; ret->processor =3D NULL; - if (virSysinfoParseX86Processor(outbuf, ret) < 0) - return NULL; - + virSysinfoParseX86Processor(outbuf, ret); ret->nmemory =3D 0; ret->memory =3D NULL; - if (virSysinfoParseX86Memory(outbuf, ret) < 0) - return NULL; + virSysinfoParseX86Memory(outbuf, ret); =20 return g_steal_pointer(&ret); } --=20 2.42.2