qemu: Resolve Coverity FORWARD_NULL

Coverity points out that qemuMonitorGetAllBlockStatsInfo could return a
-1 and thus not fill in 'stats' (leaving it NULL). Then the call to
qemuMonitorBlockStatsUpdateCapacity will dereference it.
This commit is contained in:
John Ferlan 2015-05-05 07:13:19 -04:00
parent 3e4ce35926
commit b8e60f00d8

View File

@ -19633,8 +19633,9 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, dom);
rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats,
visitBacking);
ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats,
visitBacking));
if (rc >= 0)
ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats,
visitBacking));
if (qemuDomainObjExitMonitor(driver, dom) < 0)
goto cleanup;