]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Resolve Coverity REVERSE_INULL
authorJohn Ferlan <jferlan@redhat.com>
Thu, 4 Sep 2014 14:12:13 +0000 (10:12 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 11 Sep 2014 11:33:19 +0000 (07:33 -0400)
Coverity complains that checking for !domlist after setting doms = domlist
and making a deref of doms just above

It seems the call in question was intended to me made in the case that
'doms' was passed in and not when the virDomainObjListExport() call
allocated domlist and already called virConnectGetAllDomainStatsCheckACL().

Thus rather than check for !domlist - check that "doms != domlist" in
order to avoid the Coverity message.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_driver.c

index 184691d8998d6f268e3ef07da0bf04b839d2286e..b47d00f91ab85a6e7173073026bd6b440951dc4e 100644 (file)
@@ -17402,7 +17402,7 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
         if (!(dom = qemuDomObjFromDomain(doms[i])))
             continue;
 
-        if (!domlist &&
+        if (doms != domlist &&
             !virConnectGetAllDomainStatsCheckACL(conn, dom->def))
             continue;