[PATCH 22/26] virsh: Resolve Coverity NEGATIVE_RETURNS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Coverity notes that if virDomainGetCPUStats returns a negative value
into 'nparams' then when we end up at cleanup, the call to virTypedParams
will have issues

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 tools/virsh-domain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index f732a6e..6fe637b 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6650,6 +6650,7 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
     return ret;
 
  failed_stats:
+    nparams = 0;
     vshError(ctl, _("Failed to retrieve CPU statistics for domain '%s'"),
              virDomainGetName(dom));
     goto cleanup;
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]