render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From 3ef826f1134ed311956c9b3d75e844565aea6578 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <3ef826f1134ed311956c9b3d75e844565aea6578@dist-git>
9119d9
From: John Ferlan <jferlan@redhat.com>
9119d9
Date: Sat, 13 Dec 2014 10:10:00 +0100
9119d9
Subject: [PATCH] qemu: Resolve Coverity REVERSE_INULL
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1172570
9119d9
9119d9
Coverity complains that checking for !domlist after setting doms = domlist
9119d9
and making a deref of doms just above
9119d9
9119d9
It seems the call in question was intended to me made in the case that
9119d9
'doms' was passed in and not when the virDomainObjListExport() call
9119d9
allocated domlist and already called virConnectGetAllDomainStatsCheckACL().
9119d9
9119d9
Thus rather than check for !domlist - check that "doms != domlist" in
9119d9
order to avoid the Coverity message.
9119d9
9119d9
Signed-off-by: John Ferlan <jferlan@redhat.com>
9119d9
(cherry picked from commit 9f845b1115f0b5be1554893f1b9ca2d5a3b8c7cd)
9119d9
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_driver.c | 2 +-
9119d9
 1 file changed, 1 insertion(+), 1 deletion(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
9119d9
index fe5fe88..adf158a 100644
9119d9
--- a/src/qemu/qemu_driver.c
9119d9
+++ b/src/qemu/qemu_driver.c
9119d9
@@ -18256,7 +18256,7 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
9119d9
         if (!(dom = qemuDomObjFromDomain(doms[i])))
9119d9
             continue;
9119d9
 
9119d9
-        if (!domlist &&
9119d9
+        if (doms != domlist &&
9119d9
             !virConnectGetAllDomainStatsCheckACL(conn, dom->def))
9119d9
             continue;
9119d9
 
9119d9
-- 
9119d9
2.2.0
9119d9